Page 1 of 1
google maps API
Posted: Thu Aug 25, 2011 6:14 pm
by jmjared
Hello,
I'm trying to get the Distance matrix API from google to work with iOS... it responds with a JSON output and an XML output. any of these two supported by livecode?
been trying to get the data to display on a field or image area but it doesn't work.
any suggestions would be appreciated
Thanks!
Re: google maps API
Posted: Thu Aug 25, 2011 11:18 pm
by Dixie
Hi..
What do you want to do... get the mileage, plot the route between two points, get the text directions ?
be well
Dixie
Re: google maps API
Posted: Fri Aug 26, 2011 6:05 am
by jmjared
Hi Dixie,
get the mileage..
Thanks!
Re: google maps API
Posted: Fri Aug 26, 2011 7:23 am
by Dixie
Hi...
I have attached a stack that will get the mileage for you... The script is in the button 'Locate'.
Hope it helps..
be well
Dixie
Re: google maps API
Posted: Fri Aug 26, 2011 3:40 pm
by jmjared
wow! thanks a lot! this is exactly what I was looking for..
Re: google maps API
Posted: Mon May 21, 2018 3:36 am
by aamuelchua
For the mapStuff, can you give me an exact example? I could not seem to get the reply as LiveCode throws back an error. I tried Singapore,SGP and Tokyo,JPN
Re: google maps API
Posted: Mon May 21, 2018 6:19 am
by strongbow
The Google Maps APIs have surely changed since this example was done. I just tried it and it does get a correct response but the parsing of the returned data is no longer ok. You can easily step through the script, see the variables and determine what's wrong - and fix it hopefully!
Have fun!
Re: google maps API
Posted: Mon May 21, 2018 11:16 am
by aamuelchua
I wanted to gather the distance travelled by Air. I tried Singapore and Malaysia as it is possible to drive between these two countries. However when I tried Singapore to Japan, I could not receive any reading. Could someone please help me?
Re: google maps API
Posted: Wed Jun 13, 2018 10:50 pm
by simon.schvartzman
@strongbow can you please share the input data (start and stop contents) you used to make it work?
With the following inputs it doesn't work for me
- pic1.jpeg (28.62 KiB) Viewed 7069 times
I get the following error:
Code: Select all
executing at 6:45:04 PM
Type Operators *: error in left operand
Object Locate
Line put (theMiles && "km" && "," && (theMiles * 0.62137119) && "mi") into tTemp
Hint mouseUp
Many thanks in advance
Re: google maps API
Posted: Thu Jun 14, 2018 3:40 am
by strongbow
Try putting a breakpoint at the line:
put URL tURL into red
and then have a look at the var red. It should show you the response from google maps with details etc. That's assuming it recognised your inputs ok. I tried it with
Sydney,Australia
Melbourne, Australia
Have fun!