我想要在Swift中将位置名称字符串转换为谷歌地图中的标记经度和纬度位置。做这个的最好方式是什么? 我想显示标记的位置地址,我不知道该怎么做。用swift点击显示标记地址(街道地址)
这里是我的代码,我用来添加标记,并得到纬度和经度:
func mapView(mapView: GMSMapView, didLongPressAtCoordinate coordinate: CLLocationCoordinate2D) {
if counterMarker < 2
{
counterMarker += 1
let marker = GMSMarker(position: coordinate)
marker.appearAnimation = kGMSMarkerAnimationPop
marker.map = mapView
marker.position.latitude = coordinate.latitude
marker.position.longitude = coordinate.longitude
print(marker.position.latitude)
print(marker.position.longitude)
}
}
的可能重复: http://stackoverflow.com/questions/19025148/ios-7- add-overlay-crash-app/http://stackoverflow.com/questions/6721124/app-crashing-when-i-add-overlay-to-mkmapview/ http://stackoverflow.com/questions/31390630/exc-使用gmaps-sdk-1-9-0-xcode-6-4-runing-on-8-3-device/http://stackoverflow.com/questions/31264537/adding-google-maps- as-subview-crashes-ios-app-with-exc-bad/http://stackoverflow.com/questions/24837295/how-to-solve-this-exc-bad-accesscode-exc-i38 6-gpflt-in-swift-programming –