2016-10-29 3 views
1

iOS SDKMapbox의지도와 현재 마커 (MGLPointAnnotation)를 사용하는 앱이 있습니다.Mapbox iOS SDK에서 MGLPointAnnotation 이미지를 동적으로 변경

마커를 선택한 경우 이미지를 변경하고 싶습니다.

MGLPointAnnotation에는 image 속성이없고 대표 메서드 mapView(mapView, imageForAnnotation annotation)을 호출하려고했지만 작동하지 않았습니다.

어떻게하면됩니까?

감사합니다. (그것이 annotationView은 제외)

답변

0
  1. 난 이후지도에 추가 된 주석을 변경할 수있는 방법이 없다는 것을 확신 추가 할 때

  2. mapView(mapView, imageForAnnotation annotation)은, 호출되는 주석. 당신이 할 수있는 일

  3. 원하는 이미지로 didselect의 delegete

func mapView(_ mapView: MGLMapView, didSelect annotationView: MGLAnnotationView){ //code } 그리고 같은 위치에 새로운 주석이 설정되어 있지만이 시간을 사용하는 것입니다. 그런 다음 이미지 주석 대표는 이미지가 정의한 경우, 호출되는

func mapView(_ mapView: MGLMapView, imageFor annotation: MGLAnnotation) -> MGLAnnotationImage? { 
//code 
} 

여기에 고객 마커 이미지에 대한 예입니다 : https://www.mapbox.com/ios-sdk/examples/marker-image/

관련 문제