datalink Posted May 19, 2014 Posted May 19, 2014 We have a client that with a solution in the field in FM Go. They would like to be able to touch a button within their solution that will cause the device to flip from Go to the Map App, input the address from the FM Go record, and have the Map app plot GPS directions from the operator's current location to the client address. Any suggestions for resources for this type of work or perhaps someone already has some code for this they might be willing to share? Thanks in advance!
eos Posted May 19, 2014 Posted May 19, 2014 Have a look at this: https://developer.apple.com/library/ios/featuredarticles/iPhoneURLScheme_Reference/MapLinks/MapLinks.html
jbante Posted May 19, 2014 Posted May 19, 2014 The second half of this blog post describes how to do this for several popular mapping/turn-by-turn navigation apps.
eos Posted May 19, 2014 Posted May 19, 2014 The second half of this blog post […] I get the strangest feeling of déjà vu …
datalink Posted June 5, 2014 Author Posted June 5, 2014 I seem to have gotten this sort of working. I've used the Open URL script step with the following calculation. (The _Address custom function just does some house keeping on the address info.) This doesn't flip the operator to the Map App, but rather seems to call a google maps page. Can anyone suggest how this calculation should be modified to switch to the Map App and cause it to create driving directions from current location to the specified address? I'd appreciate any further suggestions that anyone could make. Thanks in advance. "http://maps.apple.com/?daddr=" & _Address ( CLI__Clients.tog::AddressOne ; CLI__Clients.tog::AddressTwo ; Clients.tog::City ; CLI__Clients.tog::State ; CLI__Clients.tog::Zip )
jbante Posted June 5, 2014 Posted June 5, 2014 Apple's documentation is actually wrong about the URL interface. On iOS, use maps:/, not http://maps.apple.com/, like this: If ( Get ( SystemPlatform ) = 3 ; // iOS "maps:/" ; /* Else */ "http://maps.apple.com/" ) & "?daddr=" // destination address & $address What's cool about the Apple Maps URL is that you can use the as-documented URL scheme on desktop Macs (Mavericks and later) and it opens the Maps app instead of a web browser.
datalink Posted June 9, 2014 Author Posted June 9, 2014 Thanks so much for your help with this @jbante. This works as I'd like. I wonder if there is a something that can be added to the URL that would cause the Current Location to be added as the last & $address and cause it to calculate the route. My understanding of URL coding isn't clear enough yet to be able to figure this out. It would only save our operators two touches on their devices so its not that important, but would be a nice perk if its possible easily. Thanks again.
jbante Posted June 10, 2014 Posted June 10, 2014 As Apple's documentation explains, the URLs accept a "saddr" ("source address") parameter, which you could set with the current address if you happen to know it. I haven't tested if it accepts coordinates, which you could get from the Location functions, but it might be worth trying. If you're looking to save taps, using Navigon or Waze instead of Apple Maps for navigation could be worth looking into. Both of these apps let you skip straight to navigation from a URL without asking the user to confirm first. (Waze only supports this behavior if you specify the destination as coordinates. Navigon does this for both coordinates and addresses.)
datalink Posted June 10, 2014 Author Posted June 10, 2014 Thank you so much for these suggestions! I'll play around with these ideas and I appreciate having them. All the best!
Matt Malyschko Posted August 6, 2014 Posted August 6, 2014 I used this on iPad with the Open URL step. "maps://http://maps.google.com/maps?q=" & Clients::Address Combined Where Address Combined is: Address 1 Address 2 Suburb, State, Postcode, Australia
jbante Posted August 8, 2014 Posted August 8, 2014 Matty, which app are you trying to open with the address? It isn't clear from your example whether you're trying to open Apple Maps or Google Maps. How does that URL work for you? Are you trying to get directions, or just show the location on a map? Assuming you're trying to get directions (since that would be more consistent with the topic of this thread), the URL to use for Apple Maps would be this: "maps:/?daddr=" & Clients::Address Combined And for Google Maps: "comgooglemaps:/?daddr=" & Clients::Address Combined
Matt Malyschko Posted August 14, 2014 Posted August 14, 2014 Matty, which app are you trying to open with the address? It isn't clear from your example whether you're trying to open Apple Maps or Google Maps. How does that URL work for you? Are you trying to get directions, or just show the location on a map? Assuming you're trying to get directions (since that would be more consistent with the topic of this thread), the URL to use for Apple Maps would be this: "maps:/?daddr=" & Clients::Address Combined And for Google Maps: "comgooglemaps:/?daddr=" & Clients::Address Combined Is the Apple Maps you are referring to the default Maps app on iOS? If so, then the URL I listed is tested and working on my iPad Air and iPhone 5S. On a related note, have you had any success getting this to work for Safari? I can successfully get URLs to open directly in Google Chrome using "googlechrome://" & $url (where $url does not contain http://), but not for Safari.. maybe I'm using the wrong code or something..
Recommended Posts
This topic is 3752 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now