2016-10-10 5 views
-1

google map 통합을 만들고 싶습니다. 이미 GMSMapView이 있으며 제대로 작동합니다.스위프트 /지도 핀의 현재 주소를 얻는 방법

는하지만 제가 정확히하고 싶은 것은 내가지도를 밀어 세계의 다른 부분으로 이동할 때 나는 해결책을 어디서든 찾을 수없는 불행하게도

있는 접지 핀 고정 핀의 주소를 얻을 수 있다는 것입니다 . 고정 된 핀을 화면 중앙에 배치 할 수 없습니다.

그래서 내가 고정 핀을 배치 할 및 사용자가지도 주소의 변경 값을 얻을로 이동하려고 할 때

+0

작동을 위해 나는이 희망

func mapView(mapView: GMSMapView, idleAtCameraPosition position: GMSCameraPosition) { let centerCoordinates = position.target; GMSGeocoder().reverseGeocodeCoordinate(centerCoordinates) { (response:GMSReverseGeocodeResponse?, error:NSError?) in if(error != nil) { return } var address = response?.firstResult()?.lines?.joinWithSeparator(",") address = address?.stringByAppendingFormat(", %@", (response?.firstResult()?.country)!) } } 

는 GMSMapView의이 클래스를 사용하면 도움이? –

+0

예 GMSMapView를 사용하고 있습니다. – user3208123

답변

1

이 시도지도에 위치하는 핀에 의존하는 방법 GMSMapViewDelegatefunc mapView(mapView: GMSMapView, idleAtCameraPosition position: GMSCameraPosition)을 구현하므로 이동지도보기 정지하면 카메라 위치의 주소를 얻을 때 나를

관련 문제