ピンを表示するアプリ内にGoogleマップビューがあります。Google Maps SDKはピンを開けません
func setUpGoogleMapView() {
let camera = GMSCameraPosition.camera(withLatitude: self.site.latitude, longitude: self.site.longitude, zoom: 15.0)
let mapView = GMSMapView.map(withFrame: CGRect.zero, camera: camera)
mapView.frame = googleMapView.frame
self.view.addSubview(mapView)
let marker = GMSMarker()
marker.position = CLLocationCoordinate2D(latitude: self.site.latitude, longitude: self.site.longitude)
marker.title = self.site.name
marker.map = mapView
}
I手動クエリにURLを渡しUIApplication.shared.openURL
を呼び出す場合、それは別のモードで開き(注釈が場所の名前を示していない、代わりに緯度経度&を示す)、または開きませんユーザーがGoogleマップをインストールしていない場合
@IBAction func directionsButtonPressed(_ sender: UIButton) {
if (UIApplication.shared.canOpenURL(URL(string:"comgooglemaps://")!)) {
UIApplication.shared.openURL(URL(string:
"comgooglemaps://?center=\(self.site.latitude),\(self.site.longitude)&zoom=14&views=traffic&q=\(self.site.latitude),\(self.site.longitude)")!)
} else {
print("Can't use comgooglemaps://");
}
}
UIApplication.shared.openURL
を使用してサファリでGoogleマップを開くにはどうすればよいですか?
UIApplication.shared.openURL
と電話をすれば、地名のピンを表示するにはどうすればよいですか?
UIApplication.shared.openURL
を使用した後、同じ指示モードを使用したいと考えています。
はあなたが探している所望の出力のスクリーンショットを投稿できますか? – Hooda
ありがとうございます。画像を追加してリンクを追加することはできません – NatukaKh
あなたが表示しているスクリーンショットは、探している出力ですか? – Hooda