我想在网站上添加按钮,以便智能手机打开位置(纬度、经度)作为 GPS 导航应用程序中的目标。我读到点击链接,例如:
http://maps.apple.com/?q=48.6724821,19.696058
使用 Android/iOS 打开 Google map 应用程序。但是,智能手机上可能没有安装 Google map 应用程序,但有一些替代方案 - Sygic、Waze、Mapfactor 等。是否可能或确实存在 Javascript 库来使用可用的 GPS 导航应用程序打开地址,或者其他 GPS 应用程序识别上述内容链接?
最佳答案
Google map URL 方案:
A URL scheme allows you to launch a native iOS application from another iOS app or a web application. You can set options in the URL that will be passed to the launched application.
引用: https://developers.google.com/maps/documentation/ios/urlscheme
示例:<a href="comgooglemaps://?center=40.765819,-73.975866&zoom=14">Manhattan</a>
iOS URL 方案引用
示例:<a href="http://maps.apple.com/?sll=38.897517,-77.036542">The White House</a>
重要的是您的链接应始终包含正确的参数,否则它将在 Safari 中打开。
关于javascript - 使用智能手机打开 GPS 导航应用程序的网站按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31503437/