How to show the callout on click of AGSDynamicServiceMapLayer?

737
3
Jump to solution
09-13-2012 09:28 PM
Sunitapatil
New Contributor
I am adding four AGSDynamicServiceMapLayer in map view.Those AGSDynamicServiceMapLayer contains feature layers How to call out on click of those features on DynamicServiceMapLayer.
0 Kudos
1 Solution

Accepted Solutions
NimeshJarecha
Esri Regular Contributor
You can click on feature of either AGSGraphicsLayer or AGSFeatureLayer to show the callout. For dynamic map service layer, you should do following...

1. Add a AGSGraphicsLayer.
2. Implement AGSMapViewTouchDelegate and implement mapView:didClickAtPoint:mapPoint:graphics: method.
3. Execute either AGSQueryTask or AGSIdentifyTask with tap location (mapPoint) on dynamic layer.
4. The result of task will be graphics layer.
5. Set symbol and infoTemplateDelegate on each graphic and add all graphics to graphics layer.
6. Show callout by executing showCalloutxxx method on AGSMapView.

You can look at Identify Task Sample.

Regards,
Nimesh

View solution in original post

0 Kudos
3 Replies
NimeshJarecha
Esri Regular Contributor
You can click on feature of either AGSGraphicsLayer or AGSFeatureLayer to show the callout. For dynamic map service layer, you should do following...

1. Add a AGSGraphicsLayer.
2. Implement AGSMapViewTouchDelegate and implement mapView:didClickAtPoint:mapPoint:graphics: method.
3. Execute either AGSQueryTask or AGSIdentifyTask with tap location (mapPoint) on dynamic layer.
4. The result of task will be graphics layer.
5. Set symbol and infoTemplateDelegate on each graphic and add all graphics to graphics layer.
6. Show callout by executing showCalloutxxx method on AGSMapView.

You can look at Identify Task Sample.

Regards,
Nimesh
0 Kudos
Sunitapatil
New Contributor
Thanks.........
But it is showing callout for one feature layer from one dynamic map service layer. And I want to show the callout on every layer Then how we do this with every layer?
Please tell me how to do this.....
0 Kudos
NimeshJarecha
Esri Regular Contributor
You'll have to execute task against each layer.

Regards,
Nimesh
0 Kudos