Displaying an annotation layer in the Silverlight map control

578
2
10-17-2011 05:22 AM
AndyFrench
New Contributor
I am trying to render a pipe network using the ArcGIS Silverlight tools. We are using MVVM (Caliburn.Micro) and have configured the ESRI Map control by binding the layers collection to a view-model:

<esri:Map x:Name="MyMap" Layers="{Binding Layers}" ></ esri:Map>


In the view-model we build the layers collection in code. This has worked fine and we are able to render the pipe network, valves etc in different feature layers. We have to build the layers in code and bind to the view so we can access a feature layer that???s in selection only mode and pick up user selections.

However, I would like to render an ID next to each pipe. We have created an annotation layer in our map server service but the annotations only render as red rectangles next to the pipes.

I???m completely stumped. Does anyone have any suggestions as to how I can display annotation layers correctly?
0 Kudos
2 Replies
JenniferNery
Esri Regular Contributor
You can probably use a GraphicsLayer whose graphics have the same geometry as your layer. Use graphic.Attributes to set/get graphic annotation and display through TextSymbol.
0 Kudos
AndyFrench
New Contributor
Thanks for the suggestion Jennifer.

We have solved this using a different approach. Originally our annotation layer was included as a separate layer in a service that exposes a number of different layers; including the pipes we wanted annotating.

Trying to render the annotations in a FeatureLayer was failing so the solution has been to move the pipes and annotations into a separate service and render them both using an ArcGISDynamicMapServiceLayer. This renders the annotations perfectly.
0 Kudos