ios - Cordova iOS 启动 comgooglemaps 失败

标签 ios iphone google-maps cordova google-maps-urls

我有一个小问题。 我使用 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/

相关文章:

ios - 对成员(member)上传 alamofire 的引用不明确

iphone - UINavigationController 呈现空白 View

iphone - 如何创建一个完整的 NSDate 对象来表示下一个指定的日期时间?

javascript - 自定义标记集群(来自 Google Maps API)未正确渲染

javascript - Bootstrap 谷歌地图不显示小于 960px

ios - 每周重复通知和具体开始日期

objective-c - iOS从nsdata压缩图片

ios - 我将在哪里获得用于实现 Azure B2c 身份验证的 kGraphURI 和 kScopes

iphone - 在不使用 UITabBar 或 Nav Controller 的情况下交换 View Controller

jquery - 试图过滤类