Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
50
Binding map layer to a collection
posted

I have a list of elements. I'm trying to create a map layer with elements which are binded that list. In the code below there is a mapLayer called "EndpointsIcon Layer" and the datasource is binded to the list. I'm using dataMapping to place icons on the map according to the location of each element in the list. Unfortunately it doesn't work. When running the program i can see the map but not the icons.

Does anyone know what can cause the problem?

<igMap:XamMap x:Name="theMap" Margin="5" Background="Transparent" ViewportBackground="Transparent">

 <igMap:XamMap.Layers>

 

 

 

 

 

  <igMap:MapLayer LayerName="statesLayer"    FillMode="RandomInterpolate" Style="{StaticResource MapStyle}" ToolTip="{}{Name}: Pop. {Value:n0}">

 

 

 

 

   <igMap:MapLayer.Reader>

 

 

 

 

    <igMap:ShapeFileReader Uri="ShapeFiles/world"/>

 

 

 

 

   </igMap:MapLayer.Reader>

 

 

 

 

  </igMap:MapLayer>

 

 

 

 

  <igMap:MapLayer LayerName="EndpointsIconsLayer" IsAutoWorldRect="True" DataMapping="Value=Val;ToolTip=Str;SymbolOrigin=Poi;" DataSource="Try">

 

 

 

 

 

   <igMap:MapLayer.ValueTemplate>

 

 

 

 

    <DataTemplate>

 

 

 

 

 

     <Image Width="40" Height="40" Source="/NC.Client.Silverlight.Infra;component/Resources/Images/add_big.png" Stretch="UniformToFill"/>

 

 

 

 

    </DataTemplate>

 

 

 

 

   </igMap:MapLayer.ValueTemplate>

 

 

 

 

  </igMap:MapLayer>

 

 

 

 

 </igMap:XamMap.Layers>

 

 

 

 

 <igMap:MapThumbnailPane Width="150" Height="100" HorizontalAlignment="Center" Margin="0,0,0,10" Background="Transparent" igControls:XamDock.Edge="InsideBottom" Style="{StaticResource MapThumbnailStyle}"/>

 

 

 

 

 <igMap:MapNavigationPane Margin="5" igControls:XamDock.Edge="InsideRight" HorizontalAlignment="Center"/>

 

 

 

 

</igMap:XamMap>

Parents
No Data
Reply
  • 28496
    Offline posted

    for layers added at runtime, the MapLayer.Import() method must be invoked.  if you want to fit the window to the new bounds of the layer, XamMap.WindowFit() must be invoked.

    does this solve the problem?

Children