无法为mapbox添加anntation

时间:2014-05-29 02:38:45

标签: map annotations offline mapbox

我无法为离线地图添加注释。帮帮我谢谢,

RMAnnotation *annotation = [RMAnnotation annotationWithMapView:mapView coordinate:CLLocationCoordinate2DMake(34.293247,108.896141) andTitle:@"nohao"];
UIImage *flagImage=[UIImage imageNamed:@"Compass.png"];
annotation.userInfo = flagImage;
annotation.title=@"haha";
annotation.subtitle=@"what this";
annotation.annotationIcon=flagImage;
[mapView addAnnotation:annotation];

1 个答案:

答案 0 :(得分:0)

看起来您的注释已添加好了。您可以查看mapView.annotations进行检查。你可能意味着地图上没有任何东西出现。您需要使用-[RMMapViewDelegate mapView:layerForAnnotation:]方法返回有效图层(例如RMMarkerRMShape),或者使用自动执行此操作的类,例如RMPointAnnotation

https://www.mapbox.com/mapbox-ios-sdk/examples/marker/