I'm building a client using the ArcGIS WPF libraries, that's displaying my entities on a world map. I'm using an ArcGISDynamicMapServiceLayer
to display the geographic and topographic base map, and I'm now wondering what's the best way to show my custom entity layer.
At first, I used a FeatureLayer
object, linked to the layer's published URL, to display the entities on the map. This worked great in that it showed the entity symbology and allowed me to interact with it (catch right-clicks, select/deselect), but it doesn't show the labels associated with the entity, just the symbology.
So I tried using a second ArcGISDynamicMapServiceLayer to display the entities, which gives me data labels, but without the interactivity.
So now, since these are both client requirements, I find myself using BOTH, and synchronizing visibility between the two instances of the layer, once as a FeatureLayer, and once under a dynamic layer. This is not a good practice, and bugs rear their head constantly.
So my question is - what's the best way to achieve those two goals? Is there a simple way to add my own data labels on the map for each entity? There could be hundreds of them on 5-6 of these entity layers, and this feels like replicating functionality that ArcGIS already offers. On the other hand, I can simulate the right-click-on-entity behavior using a DynamicMap, catching the MouseClick event, and running a Query action on the map to find the entities clicked, but this, again, is reinventing parts of the wheel, and leaves some unsolved issues.
So what would you do? How do I get those two requirements together without ugly hacks?