简体   繁体   中英

Create a link for all mobile devices that opens google maps by default

Create a link for all mobile devices that opens google maps with business location?

<a href="geo:37.6894694,-121.000303">Google MAP</a> - This link goes to the location and redirect to the mobile google app, but no mark for the business address.

<a href="http://maps.apple.com/maps?q=Business Address">Google MAP</a> - This link goes to the location, but not redirecting to google app, instead mobile wants you to choose what to use.

I need a link that redirect to google app and mark the google Business address.

<a href="geo:37.6894694,-121.000303?q=37.6894694,-121.000303(The Name You Want To Show)">Google MAP</a>

Use the q parameter with () for showing the marker name

It works with android devices, but I'm not sure it works with iOS devices.

Read more:

https://developers.google.com/maps/documentation/android-api/intents#overview

https://developer.android.com/guide/components/intents-common.html

在此处输入图片说明

In May 2017 Google launched the Google Maps URLs. This API allows to create universal cross-platform URLs that you can use on web, Android or iOS.

For example you can open native maps app on Android passing the following URLs into intents

https://www.google.com/maps/search/?api=1&query=centurylink+field

https://www.google.com/maps/search/?api=1&query=47.5951518,-122.3316393&query_place_id=ChIJKxjxuaNqkFQR3CK6O1HNNqY

For further details, please refer to the documentation:

https://developers.google.com/maps/documentation/urls/guide

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM