//以上代码就是添加多点到图层里面,添加委托
//AGSInfoTemplateDelegate 就可以在
//组装点要素方法的参数infoTemplateDelegate:self,具体触发方法如下
/** Title text to be displayed in the callout.
@param graphic The graphic to display a title for.
@param screen The coordinates at which the graphic callout will be displayed.
@param mapPoint The coordinates at which the graphic callout will be displayed.
@return The title text for the callout.
@since 1.0
*/
- (NSString *)titleForGraphic:(AGSGraphic *)graphic screenPoint:(CGPoint)screen mapPoint:(AGSPoint *)mapPoint{
return @"title";
}
/** Detail string to be displayed in the callout.
@param graphic The graphic to display detail for.
@param screen The coordinates at which the graphic callout will be displayed.
@param mapPoint The coordinates at which the graphic callout will be displayed.
@return The detail text for the callout.
@since 1.0
*/
- (NSString *)detailForGraphic:(AGSGraphic *)graphic screenPoint:(CGPoint)screen mapPoint:(AGSPoint *)mapPoint{
return @"Detail";
}
/** Image to be displayed in the callout to the left of the text. The image will be scaled to
40x40 points.
@param graphic The graphic to display the image for.
@param screen The coordinates at which the graphic callout will be displayed.
@param mapPoint The coordinates at which the graphic callout will be displayed.
@return The image to be displayed in the callout.
@since 1.8
*/
-(AGSImage*)imageForGraphic:(AGSGraphic *)graphic screenPoint:(CGPoint)screen mapPoint:(AGSPoint *)mapPoint{
NSLog(@"+++%f",mapPoint.x);
return nil;
}
/** The custom view to be displayed in the callout. If you implement this function then the title, detail
and image methods will not get called, as only the custom view will be displayed in the callout. The callout will be expanded
to the dimensions of the custom view.
@param graphic The graphic to display the custom view for.
@param screen The coordinates at which the graphic callout will be displayed.
@param mapPoint The coordinates at which the graphic callout will be displayed.
@return The custom view to be displayed in the callout.
@since 1.8
*/
-(AGSView*)customViewForGraphic:(AGSGraphic *)graphic screenPoint:(CGPoint)screen mapPoint:(AGSPoint *)mapPoint{
return nil;
}
//具体需要看着几个方法的英文翻译,需要点击弹出视图就实现customViewForGraphic方法,返回一个AGSView 就可以实现点击覆盖物弹出自定义视图了