Select to view content in your preferred language

Question about maptips, identify, and layers.

842
3
06-14-2010 02:15 PM
DougCollins
Regular Contributor
Greetings,
I am trying to sort out the best way to provide a good combination of maptips, identify, and layer control in the TOC.  It seems that if you want to provide an identify capability you need to use the ArcGISDynamicMapServiceLayer, but to use maptips you need to use FeatureLayers.  Is this correct? 

Also the layers in the TOC seem to be dependent upon the ArcGISDynamicMapServiceLayers.  The FeatureLayers show up in the TOC but the checkbox does not hide/unhide the features.  I am putting the layers in a Listbox by binding to the Layers as in:   ItemsSource="{Binding ElementName=MyMap, Path=Layers}"
Is there a better way to do this?

Thanks,
Charlie
0 Kudos
3 Replies
DominiqueBroux
Esri Frequent Contributor
The binding looks correct to me.

Then you have to verify the binding between the checkbox and the 'Visible' layer property. But, as it's working for most layers, I guess it's correct.
What is exactly the issue with the feature layer? Is it only a refresh issue (i.e it's working fine after you zoom or pan the map, but it's not working at the exact moment you check or uncheck the visibility)?
0 Kudos
DougCollins
Regular Contributor
Thanks for the reply Dominique.
I guess my issue is that if I add the ArcGISDynamicMapServiceLayer for a service, I get all the layers in that service represented by one item in the TOC.  This is fine in that I can toggle the layers on or off and query them.  However if I now want to get maptips on the layers in that service, I need to add each layer independently as a FeatureLayer.  The problem with doing this is that in addition to having an entry for the service in the TOC, I also get each layer in that service listed in the TOC.  This is fine except that by clicking on the checkbox next to one of the layers, it does not toggle the visibility of that layer.  The checkbox for the service is the only way to toggle the visibility of All the layers at once.

If the checkbox for the individual FeatureLayers in the TOC would toggle their visibility, that would be a nice feature.

Thanks,
Charlie
0 Kudos
DominiqueBroux
Esri Frequent Contributor
Hi Charlie,

When you say:

The checkbox for the service is the only way to toggle the visibility of All the layers at once.

it looks like you are adding the ArcGISDynamicMapServiceLayer AND the feature layers to your map.
This would mean that the same features are displayed twice, once with the map service and once with the feature layer. Then you would have to switch off the 2 layers to get nothing.

You have to decide to use either one ArcGISDynamicMapServiceLayer or many feature layers.

It's true that to get maptips you need feature layers, but you will download an enormous amount of data.
If maptips are your only reason to use feature layers, I think you should rather consider to use the identify task with a DynamicMapServiceLayer.
0 Kudos