How do I Access Map location on mobile?

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
Mag
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 802
Joined: Fri Nov 16, 2012 10:51 pm

How do I Access Map location on mobile?

Post by Mag » Wed Oct 02, 2013 2:47 pm

Hi all!

I want to implement a button that opens the map app of the device and shows a specific location.

I saw this lesson http://lessons.runrev.com/s/lessons/m/4 ... aps-on-ios but it is missing the way to specific a location, I also read this amazing topic http://ftp.runrev.com/forums/viewtopic. ... 47&p=73479 but it's a bit too advanced for my purposes.

Does anyone know how do you open the maps at a specific point?

Mag
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 802
Joined: Fri Nov 16, 2012 10:51 pm

Re: How do I Access Map location on mobile?

Post by Mag » Fri Oct 04, 2013 4:22 pm

No ideas?


Your message contains 9 characters. The minimum number of characters you need to enter is 10.

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: How do I Access Map location on mobile?

Post by Simon » Fri Oct 04, 2013 5:42 pm

Hi Mag,
Here are 3 url types:
http://maps.google.com/maps?q=Palo%20Alto
http://maps.google.com/maps?q=55.953969,-3.198784
http://maps.google.com/maps?q=Walmart
Just change the lat/lon to where you are or the the name you want to search.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Mag
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 802
Joined: Fri Nov 16, 2012 10:51 pm

Re: How do I Access Map location on mobile?

Post by Mag » Sat Oct 05, 2013 10:21 am

Thank you so much Simon. Very useful info!

PS
Unfortunately under iOS in my tests this don't opens the default Maps but Safari, would be great to get to open the default Map app.

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: How do I Access Map location on mobile?

Post by Simon » Sat Oct 05, 2013 4:42 pm

Ahh yes, sorry I forgot iOS has their own mapping program.
Not sure how to trigger that one. :(

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Mag
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 802
Joined: Fri Nov 16, 2012 10:51 pm

Re: How do I Access Map location on mobile?

Post by Mag » Sun Oct 06, 2013 7:54 pm

I Simon,

Your hel was important, I will follow that way, users like also google maps.

I think that a way could exist a way to open iOS own maps, but it needs to study a way to do it... http://stackoverflow.com/questions/1250 ... p-in-ios-6

Nakia
Posts: 425
Joined: Tue Feb 21, 2012 8:57 am

Re: How do I Access Map location on mobile?

Post by Nakia » Tue Oct 08, 2013 6:15 am

Mag,

I have used the method you mention in the stack overflow article and it works fine.

Mag
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 802
Joined: Fri Nov 16, 2012 10:51 pm

Re: How do I Access Map location on mobile?

Post by Mag » Thu Oct 24, 2013 11:17 am

Thank you Nakia,

Ok, for convenience I post here the code to open the maps based on the device (if anyone has the enhancements please post as well):

Code: Select all

   if the platform is "android" then -- use the google maps
      launch url "https://maps.google.it/maps?q=one+infinite+loop+1+cupertino"
   else if the platform is "iphone" then -- use the apple maps
      launch url "http://maps.apple.com/maps?q=one+infinite+loop+1+cupertino"
   end if

Post Reply