我有一个小问题。 我使用 comgooglemaps 方案来调用谷歌地图并执行搜索。 这工作正常,但问题是如果用户没有安装谷歌地图。
现在...我如何检查这个以及是否未安装谷歌地图以通过浏览器调用谷歌? ...或调用用户使用的其他 map 应用程序?
谢谢!
最佳答案
您可以使用 Google Maps URLs提供通用的跨平台 URL 来启动 Google map 。目前,这是推荐和支持的打开 Google map 应用程序的方式。
根据文档
On an iOS device:
If Google Maps app for iOS is installed, the URL launches Google Maps in the Maps app and performs the requested action.
If the Google Maps app is not installed, the URL launches Google Maps in a browser and performs the requested action.
这种行为与您所询问的差不多,因此请将 comgooglemaps 方案替换为 Google map URL(例如 https://www.google.com/maps/search/?api=1¶meters
)你就安顿下来了。
希望对您有所帮助!
关于ios - Cordova iOS 启动 comgooglemaps 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50379588/