Search code examples
xamlsilverlightbindingesri

Esri Silverlight control. How do I bind layer similar to Bing maps?


I'm switching out of Bing Maps into ESRI but have hard time finding sample which will do the same thing..

I have layer on top of base map showing position of assets. Data bound via MVVM.

This is code from Bing Maps:

<m:MapItemsControl ItemsSource="{Binding Source={StaticResource WorkLayerData}}">
  <m:MapItemsControl.ItemTemplate>
    <DataTemplate>
      <Canvas .. coordinate properties
       .... STUFF drawn here.....

      </Canvas>                                               
    </DataTemplate>
  </m:MapItemsControl.ItemTemplate>
</m:MapItemsControl>

I figured that most close is ElementLayer in ESRI Silverlight control, but can't figure out how to bind it to my datasource and achieve similar result.

I can't even post what I've tried because all samples I found on ESRI website just do static elements, but I need to bind collection.

Any pointers?


Solution

  • You probably want to be using an Esri FeatureLayer, which can connect to either a MapService (if you use an Esri map server) or a spatial data service.

    Have you looked at the online samples here?

    https://developers.arcgis.com/silverlight/sample-code/start.htm#FeatureLayerSimple