xhr Asked:2020-12-20 03:21:34 +0000 UTC2020-12-20 03:21:34 +0000 UTC 2020-12-20 03:21:34 +0000 UTC 如何通过openURL打开谷歌地图在谷歌地图中建立路线? 772 如何通过openURL在本机应用程序中打开谷歌地图中的两点之间的路线? swift 1 个回答 Voted Best Answer xhr 2020-12-20T16:02:44Z2020-12-20T16:02:44Z 您可以这样做: if UIApplication.shared.canOpenURL(URL(string:"comgooglemaps://")!) { let urlString = "comgooglemaps://?saddr=&daddr=51.532147,46.612396&directionsmode=driving" UIApplication.shared.open(URL(string: urlString)!) } 您还需要记住为参数添加密钥comgooglemaps(info.plist有关LSApplicationQueriesSchemes密钥的更多详细信息,请参见此处)。
您可以这样做:
您还需要记住为参数添加密钥
comgooglemaps(info.plist有关LSApplicationQueriesSchemes密钥的更多详细信息,请参见此处)。