Page 1 of 1

LiveCode & Google maps

Posted: Tue Feb 15, 2011 12:56 pm
by Dixie
Could some please point me in the right direction (no pun intended !)

I would like to use the browser object in a stack to display a google map… that I can do. I would like to be able to choose a postcode or the name of a town or village from a list in a field in the stack to place the two markers, showing the start and finish location, get the direction drawn on the google map and the total distance put into another field in the stack...

If someone could point me in the the right direction (no pun intended !) of how to go about doing this from within LiveCode… it would be appreciated.

Dixie

Re: LiveCode & Google maps

Posted: Tue Nov 15, 2011 1:26 pm
by mtimmerm
Hi,

Do you have already found out how to do this? Can you help me as well? I am looking for something similer.

Re: LiveCode & Google maps

Posted: Wed Nov 16, 2011 9:47 am
by AndyP
Hi Dixie,

The asiest way to do this to to access the Google Maps API

Go to this example page then look at the source, it should be easy to post and receive values with LiveCode using this method.

http://code.google.com/apis/maps/docume ... panel.html

More examples here:

http://code.google.com/apis/maps/docume ... index.html

Let us know how you get on.

Re: LiveCode & Google maps

Posted: Wed Nov 16, 2011 10:07 am
by Dixie
mtimmerm...

In this example stack that is attached, the location always opens centered on Wells in the UK as that is where I live, but you can change the lat/lng in the .html file to centre the map wherever you wish... When you enter a start/Destination location, also include the country as I have not done any region biasing... eg Wells,UK or Amiens,FR. AndyP is quite correct, you should look at the Google API documentation.

(Andy - getting liveCode and javaScript to play nicely was actually a little trying !)

hope it helps...

Dixie

Re: LiveCode & Google maps

Posted: Wed Nov 16, 2011 10:13 am
by AndyP
Hi Dixie,

Great example. I was in the process of putting one together but you beat me to the punch!

Re: LiveCode & Google maps

Posted: Wed Nov 16, 2011 11:29 am
by mtimmerm
Dixie wrote:In this example stack that is attached, the location always opens centered on Wells in the UK as that is where I live, but you can change the lat/lng in the .html file to centre the map wherever you wish... When you enter a start/Destination location, also include the country as I have not done any region biasing... eg Wells,UK or Amiens,FR. AndyP is quite correct, you should look at the Google API documentation.

hope it helps...
this helps indeed! Thanks a lot!