I am building a site that will have address links as well as image of a map - both of which have a link to Google Maps.
The problem is that when I click on these links u
Take a look at this.
It works on every device (for ios / android, it will launch google maps app else browser).
For other devices, it will launch browser.
Simple use case would be:
Use this URL like -
window.open(mapUrl, '_system');
More info for window.open here
My use case required to open existing in app map navigation into some another dedicated maps app (preferably google maps app) for ios and android devices.
I use ionic v1 + cordova for building native apps. Not sure if this is perfect for your use case but hope this helps.
To open Google native app you need to write:
[[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"comgooglemaps://"]];
Example :
comgooglemaps://?q=Pizza¢er=37.759748,-122.427135
I just tested this and it worked in pulling up Google Maps instead of the default Apple Maps application.
<a href="comgooglemaps://?center=40.765819,-73.975866&zoom=14&views=traffic">Testing Maps</a>
However, after deleting the Google Maps app for iOS, the link fails to open anything because that schema is no longer available and doesn't fallback to a generic maps link... almost seems like you would need to provide two links for Google Maps for iPhone and another generic Apple Map link...
You can use apple's interface which is a bit more intelligent when using different browsers and devices:
http://maps.apple.com/?q=51.507269,-0.127695
Clicking the above url on the following devices:
iPhone|iPad: Opens Apple maps app
Android: Gives you a choice to open in either Google Maps App or Google maps website
Windows Phone: Opens Google maps mobile website
Windows 8 Desktop: Opens Google maps website
Apple OS Desktop: Opens the new maps app (Mavericks)!!
For more info see: Apple URL Scheme Reference