I am wanting to show callouts when the map zooms to their coordinates. I have a table view controller that list all of the callouts and zooms to their location when pressed. This is the method:
-(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];
}
}
}
I have looked on ARCGIS SDK for iOS and found a class reference for AGSCallout:
- (void) showCalloutAt:(AGSPoint *) screenOffset:(CGPoint)
animated:(BOOL)
Every time i try to use this it says that this method is deprecated.
您可以改用此方法。
- (BOOL) showCalloutAtPoint:(AGSPoint *)mapPoint forFeature:(id< AGSFeature >)feature layer:(AGSLayer< AGSHitTestable > *)layer animated:(BOOL)animated
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.