ARCGIS会自动在地图上显示标注

时间:2015-08-13 19:59:22

标签: ios objective-c arcgis

我希望在地图缩放到其坐标时显示标注。我有一个表视图控制器,列出所有标注,并在按下时缩放到它们的位置。这是方法:

-(void)handlePodNotifications:(NSNotification *) notification
{
if ([[notification name] isEqualToString:@"PodInteraction"])
{
    PodInteractionObject *interactionObject = [notification object];

    if([interactionObject.interactionName isEqualToString:@"ZoomToCrew"])
    {
        AGSGraphic *temp = (AGSGraphic *)interactionObject.interactionObject;
        CGPointMake(0, 0);
        double xcoord = [[temp valueForKey:@"lon"] doubleValue];
        double ycoord = [[temp valueForKey:@"lat"] doubleValue];
        AGSPoint *newPoint = [AGSPoint pointWithX:xcoord y:ycoord spatialReference:[AGSSpatialReference wgs84SpatialReference]];

        [self.mapView zoomToResolution:.2 withCenterPoint:newPoint animated:YES];
        [self.mapView allowCallout];


    }

}
}

我查看了ARCGIS SDK for iOS,并找到了AGSCallout的类引用:

 - (void) showCalloutAt:(AGSPoint *) screenOffset:(CGPoint)
animated:(BOOL)

每次我尝试使用它时都会声明此方法已被弃用。

1 个答案:

答案 0 :(得分:1)

您可以改用此方法。

 - (BOOL) showCalloutAtPoint:(AGSPoint *)mapPoint forFeature:(id< AGSFeature >)feature layer:(AGSLayer< AGSHitTestable > *)layer animated:(BOOL)animated