내가 RMPolylines 및 RMShapes를 사용하여 새로운 오전과 내가 올바르게 코드를 실행하고 있지만 아무것도 맵에 표시되지 않습니다 생각 :아이폰 OS MapBox RMShape
RMMapBoxSource *tilesource = [[RMMapBoxSource alloc] initWithMapID:kMapID];
[mapView setTileSource:tilesource];
NSArray *locations = [NSArray arrayWithObjects:[[CLLocation alloc] initWithLatitude:-33.981595 longitude:151.072900],[[CLLocation alloc] initWithLatitude:-33.981560 longitude:151.073544],[[CLLocation alloc] initWithLatitude:-33.981560 longitude:151.073845],[[CLLocation alloc] initWithLatitude:-33.981666 longitude:151.074016], nil];
RMAnnotation *annoation43 = [[RMAnnotation alloc] initWithMapView:mapView coordinate:((CLLocation *)[locations objectAtIndex:0]).coordinate andTitle:@"Hola biatches!"];
annoation43.userInfo = locations;
[annoation43 setBoundingBoxFromLocations:locations];
[mapView addAnnotation:annoation43];
-(RMMapLayer *)mapView:(RMMapView *)mapViewer layerForAnnotation:(RMAnnotation *)annotation
{
if (annotation.isUserLocationAnnotation)
return nil;
RMShape *shape = [[RMShape alloc] initWithView:mapView];
shape.lineColor = [UIColor orangeColor];
shape.lineWidth = 5.0;
for (CLLocation *location in (NSArray *)annotation.userInfo)
[shape addLineToCoordinate:location.coordinate];
return shape;
NSLog(@"It is working Dora!");
}
그래서 내가 여기에 뭔가 잘못했다 생각하지만 난 그것을 선택할 수 없습니다 - 더 많은 코드 또는 정보가 필요하면 알려주세요.
네, 위임자는 반드시'-mapView : layerForAnnotation :'delegate 메소드를 사용하도록 설정해야합니다. – incanus