0
我面臨的問題,而從谷歌地圖將自動完成檢索數據,因爲我認爲沒有負載的經度和緯度[團結]薩雷默認同時顯示在地圖如何我可以通過搜索的地方
let camera = GMSCameraPosition.camera(withLatitude: 30.7096, longitude: 76.7016, zoom: 12)
let mapView = GMSMapView.map(withFrame: CGRect(x: 0, y: 58, width: 320, height: 510), camera: camera)
let marker = GMSMarker()
marker.position = camera.target
marker.snippet = "Hello World"
marker.map = mapView
self.mapSize.addSubview(mapView)
}
@IBAction func autocompleteClicked(_ sender: UIButton)
{
let autocompleteController = GMSAutocompleteViewController()
autocompleteController.delegate = self as! GMSAutocompleteViewControllerDelegate
present(autocompleteController, animated: true, completion: nil)
}
@IBOutlet weak var mapSize: UIView!
檢索座標
是的,我已經實施。 (「Place place:\(place.formattedAddress)」) print(「放置歸屬地址:「(place.attributions)」) print(「Place longitude:\(place.coordinate.longitude)」) print(「Place latitude:\(place.coordinate.latitude)」) dismiss(animated:true ,完成:無) } 我可以打印但不能更改位置 –