google maps API
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
google maps API
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!
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!
-
- Livecode Opensource Backer
- Posts: 1336
- Joined: Sun Jul 12, 2009 10:53 am
- Location: Bordeaux, France
Re: google maps API
Hi..
What do you want to do... get the mileage, plot the route between two points, get the text directions ?
be well
Dixie
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
Hi Dixie,
get the mileage..
Thanks!
get the mileage..
Thanks!
-
- Livecode Opensource Backer
- Posts: 1336
- Joined: Sun Jul 12, 2009 10:53 am
- Location: Bordeaux, France
Re: google maps API
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
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
- Attachments
-
- mapStuff.zip
- (2.26 KiB) Downloaded 437 times
Re: google maps API
wow! thanks a lot! this is exactly what I was looking for..
-
- Posts: 2
- Joined: Mon May 21, 2018 3:30 am
Re: google maps API
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
-
- VIP Livecode Opensource Backer
- Posts: 135
- Joined: Mon Jul 31, 2006 1:39 am
- Location: New Zealand, Australia, Germany, Japan
- Contact:
Re: google maps API
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!
Have fun!
-
- Posts: 2
- Joined: Mon May 21, 2018 3:30 am
Re: google maps API
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?
-
- Posts: 641
- Joined: Tue Jul 29, 2014 12:52 am
- Location: Brazil
Re: google maps API
@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
I get the following error:
Many thanks in advance
With the following inputs it doesn't work for me
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
Simon
________________________________________
To ";" or not to ";" that is the question
________________________________________
To ";" or not to ";" that is the question
-
- VIP Livecode Opensource Backer
- Posts: 135
- Joined: Mon Jul 31, 2006 1:39 am
- Location: New Zealand, Australia, Germany, Japan
- Contact:
Re: google maps API
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!
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!