Jump to content

Go and Map App


This topic is 3514 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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!

Link to comment
Share on other sites

  • 3 weeks later...

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 )

Link to comment
Share on other sites

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:/" ;
)
& "?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.
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.)

Link to comment
Share on other sites

  • 1 month later...

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

Link to comment
Share on other sites

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..

Link to comment
Share on other sites

This topic is 3514 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.