-1

I'd like to use media queries (or any other means) in my website to detect the user agent and display a link that will open in Apple Maps if the user is on an iOS device or in Google Maps if the user is on an Android device.

The only other related question I can find is here and it's quite old.

FerdTurgusen
  • 320
  • 5
  • 13
  • 1
    Duplicate of [How to launch Google Maps on iPhone via web link?](https://stackoverflow.com/questions/18223533/how-to-launch-google-maps-on-iphone-via-web-link) – MrUpsidown Sep 28 '21 at 06:53
  • @MrUpsidown The linked question in no way addresses what I've asked here. I'm asking how I can detect the user agent and provide one html element that will open the native map application on a mobile device. – FerdTurgusen Oct 09 '21 at 04:11

1 Answers1

1

To launch google maps on android, or if installed on IOS, launch this URL:

https://www.google.com/maps/

Google maps URLs
To launch apple maps on IOS devices, launch this URL:

http://maps.apple.com

Apple maps Map links

Both links will open in the browser if the app is not installed/disabled.

Mahan Lamee
  • 322
  • 3
  • 12