Jump to content

Google Maps for uniGUI


lema

Recommended Posts

ok thanks. it works.

 

but only when I show the form that contains the map from the mainform.

 

not from any other form.

 

Is strange.

 

Any idea?

Add in the main form a unigmap component and set visible to false. Then you can add and use unigmap and any other form.

Link to comment
Share on other sites

the problem is solved.

 

there was some code in the clientevent of a unitreevieww, in on exppand.

 

I've removed that code, and now it works.

 

Now I only have to know how to do markers and polygons, and this will be fine for me.

 

Thanks to everyone.

Link to comment
Share on other sites

after initializemap, must I wait any amount of time to create markers and / or polygons?

 

if I do  UniGMap1.InitializeMap; and inmediately add markers, the app. raise an error.

 

I have a button to create a mark after show a map, but I can't do it at once.

 

I dont' know what is the correcto order to make a map with marks. In  the samples, all the marks ar created with a button click, not in the formshow.

 

some help please.

 

thanks.

Link to comment
Share on other sites

after initializemap, must I wait any amount of time to create markers and / or polygons?

 

if I do  UniGMap1.InitializeMap; and inmediately add markers, the app. raise an error.

 

I have a button to create a mark after show a map, but I can't do it at once.

 

I dont' know what is the correcto order to make a map with marks. In  the samples, all the marks ar created with a button click, not in the formshow.

 

some help please.

 

thanks.

 

 

Web application works asynchronous.

 

As workaround you can use a timer with 100-200ms interval.

 

procedure TForm1.FormShow(Sender: TObject);
begin
  UniGMap1.InitializeMap;
  UniTimer1.Enabled := True;
end;

procedure TForm1.UniTimer1Timer(Sender: TObject);
begin
  UniTimer1.Enabled := False;
  //Create Markers
end;
Link to comment
Share on other sites

  • 4 weeks later...

Put a market on the map, using unigui phone

Hello, Mr. Lema, as I can place a marker , the geolocalizacion found .?

Tks 

 

Hello, I am not sure that I understood your question.

 

If you want to place a marker after the geolocation.getCurrentPosition call,

you can see the demo's GeolocationAPIFM unit.

Link to comment
Share on other sites

  • 2 weeks later...

Hi Lema,

 

THanks...that's the correct file. I just want to use some geocoding and looked at the example...but missing something? 

 

  • So i created a form which contains the UniGmap.
  • The OnShow events contains : UniGmap.Initialize;
  • Put a editbox on the form for entering the addres and a button to do the search with this code :   UniGMap1.Geocoding(UniEdit_Address.Text)

  I got this Ajax error

_rsov_(O4BF,22);var geocoder = new google.maps.Geocoder(); geocoder.geocode({"address": "standaardmolen 86 weert"}, function(results, status) {   if (status == google.maps.GeocoderStatus.OK) {     ajaxRequest(O50B, "Geocoder", ["lat="+results[0].geometry.location.lat(), "lng="+results[0].geometry.location.lng() ]);     } else {     ajaxRequest(O50B, "Geocoder", ["Geocoder failed due to: " + status]);     }   } );
Link to comment
Share on other sites

 

Hi Lema,

 

THanks...that's the correct file. I just want to use some geocoding and looked at the example...but missing something? 

 

  • So i created a form which contains the UniGmap.
  • The OnShow events contains : UniGmap.Initialize;
  • Put a editbox on the form for entering the addres and a button to do the search with this code :   UniGMap1.Geocoding(UniEdit_Address.Text)

  I got this Ajax error

_rsov_(O4BF,22);var geocoder = new google.maps.Geocoder(); geocoder.geocode({"address": "standaardmolen 86 weert"}, function(results, status) {   if (status == google.maps.GeocoderStatus.OK) {     ajaxRequest(O50B, "Geocoder", ["lat="+results[0].geometry.location.lat(), "lng="+results[0].geometry.location.lng() ]);     } else {     ajaxRequest(O50B, "Geocoder", ["Geocoder failed due to: " + status]);     }   } );

 

Hi Peter.

Can you provide a test app?

Link to comment
Share on other sites

Hi Lema,

 

I just created a fresh test project (see attachment) and now it's working. I got the error in a existing big project where i added the GMap

functionality....so i have to see what's differenbce between the test project and the existing project.

 

BUT...if have 1 question...is it possible to ad a marker / infowindow based on the given address or do you have to 
reverseGeocoding first before to adding a marker / infowindows

 

Regards PEter

Gmap.zip

Link to comment
Share on other sites

Hi Lema,

 

I just created a fresh test project (see attachment) and now it's working. I got the error in a existing big project where i added the GMap

functionality....so i have to see what's differenbce between the test project and the existing project.

 

BUT...if have 1 question...is it possible to ad a marker / infowindow based on the given address or do you have to 

reverseGeocoding first before to adding a marker / infowindows

 

Regards PEter

 

Hello.

At first, make sure that you have copied the js libraries under the directory /files

(see the demo structure)

 

Second, you will need an entry pointing to google api in your servermodule.CustomFiles.

(http://maps.googleapis.com/maps/api/js?........)

You can drop a gmap component on your main form and it will do the job for you.

(You can set its visibility to false)

 

 

And yes, you have to call at first the geocode procedure in order to get Latitude and Longitude and then use them in AddMarker.

Link to comment
Share on other sites

Now I see that marker clusterer icons are gone.

 

It's broken even on the main site's example pages

https://googlemaps.github.io/js-marker-clusterer/docs/examples.html

 

Probably Google removed the repository...

 

There is a discussion about it on github

https://github.com/googlemaps/js-marker-clusterer/issues

 

 

I think we have to host the icons locally and change accordingly the library.

icons.zip

 

 

  • Upvote 1
Link to comment
Share on other sites

  • 2 months later...

Excuse me if i reply to this post but i can't made a new post.

I have a problem with unigmap component v 1.3.4 on delphi xe2.

The component work correct on localhost but don't work on a web call for exemple work on https:\\localhost:8077 and not work on http://siracsrl2012n2.dyndns.org:8077. I try to made a new google api key but i don't solve the problem. Someone can help me.

Tnx.

Link to comment
Share on other sites

Excuse me if i reply to this post but i can't made a new post.

I have a problem with unigmap component v 1.3.4 on delphi xe2.

The component work correct on localhost but don't work on a web call for exemple work on https:\\localhost:8077 and not work on http://siracsrl2012n2.dyndns.org:8077. I try to made a new google api key but i don't solve the problem. Someone can help me.

Tnx.

 

Hello.

First of all, you must use the latest version of component (1.4.1).

 

To bypass the Google API Key, just build with the {$DEBUG} directive ON.

Link to comment
Share on other sites

Hello,

I uploaded the missing version.
 
 

2016-05-26  v1.4.1

--Fixed   Marker Cluster library image path

 

 

 

 

Please note that there are changes in included files.

1. files\markerclusterer_compiled.js  replaced by  files\markerclusterer.js

 

2. directory \images added with m*.png files (its a requirement for the new marker clusterer library)

 

 

 

 

 

 

Tested with 0.99.95.1298

 

Online demo:

http://79.143.178.31/lema/uniGMapDemo.dll

  • Upvote 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...