1
votes

I am using Mapbox iOS SDK. I installed it using cocoapods. I need to create a custom callout view and to do so I found below method in the previous SDK version 1.x.x.

- (RMMapLayer *)mapView:(RMMapView *)mapView layerForAnnotation:(RMAnnotation *)annotation

And current SDK version is 2.0 where they change the protocol name from RMMapViewDelegate to MGLMapViewDelegate, now the problem is I am not able to find the alternate method for layerForAnnotation in this new protocol. Can anybody suggest me what to do.

1

1 Answers

0
votes

Currently, you can't supply a custom view/layer as in 1.x.x, but you can provide custom imagery.

- (nullable MGLAnnotationImage *)mapView:(MGLMapView *)mapView imageForAnnotation:(id<MGLAnnotation>)annotation;

Watch this space for proper views:

https://github.com/mapbox/mapbox-gl-native/issues/1784