LiveCode & Google maps

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am

LiveCode & Google maps

Post by Dixie » Tue Feb 15, 2011 12:56 pm

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

mtimmerm
Posts: 14
Joined: Tue Nov 15, 2011 12:56 pm

Re: LiveCode & Google maps

Post by mtimmerm » Tue Nov 15, 2011 1:26 pm

Hi,

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

AndyP
Posts: 634
Joined: Wed Aug 27, 2008 12:57 pm
Contact:

Re: LiveCode & Google maps

Post by AndyP » Wed Nov 16, 2011 9:47 am

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.
Andy .... LC CLASSIC ROCKS!

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am

Re: LiveCode & Google maps

Post by Dixie » Wed Nov 16, 2011 10:07 am

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
Attachments
GoogleMapExample.zip
(10.78 KiB) Downloaded 1035 times

AndyP
Posts: 634
Joined: Wed Aug 27, 2008 12:57 pm
Contact:

Re: LiveCode & Google maps

Post by AndyP » Wed Nov 16, 2011 10:13 am

Hi Dixie,

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

mtimmerm
Posts: 14
Joined: Tue Nov 15, 2011 12:56 pm

Re: LiveCode & Google maps

Post by mtimmerm » Wed Nov 16, 2011 11:29 am

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!

Post Reply