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
240
DataMapping
posted

I have an issue with data mapping between my shapfile and the layer. The values of the shapefile elements dont get set. If the set the value of a single emelent directly in code behind it works fine.

 Could you help me out and tell me what I'm doing wrong.

<igMap:XamWebMap x:Name="floorMap"
   WindowZoomMinimum=".1" WindowZoomMaximum="5"
   Background="{x:Null}"
   ViewportBackground="{x:Null}" ViewportBorderBrush="{x:Null}" GridDisplayMode="None" WindowAnimationMode="None" WindowScale="0.85" Canvas.Left="8" Canvas.Top="8" Margin="8,139,8,156" ElementClick="floorMap_ElementClick">
   <igMap:XamWebMap.Layers>
    <igMap:MapLayer Name="statesLayer" FillMode="Chloropleth" DataMapping="Name=slotnumber; Value=TotalCashIn;" ToolTip="Total Cash In: {Value}" Stroke="{x:Null}" StrokeThickness="0" Foreground="#FFFF0000" ShadowFill="{x:Null}" Cursor="Hand">
      <igMap:MapLayer.Reader>
      <igMap:ShapeFileReader DataMapping="Name=ID; Caption=ID;" Uri="ShapeFiles/DemoFloor"/>
     </igMap:MapLayer.Reader>
     <igMap:MapLayer.ValueScale>
               <igMap:LinearScale IsAutoRange="True" MaximumValue="1500" MinimumValue="0" />
             </igMap:MapLayer.ValueScale>
    </igMap:MapLayer>
   </igMap:XamWebMap.Layers>
   <igMap:MapNavigationPane Margin="10" igMap:XamWebDock.Edge="InsideRight" />
   <igMap:MapColorSwatchPane Width="300" Height="50" Margin="0, 10, 0, 0" igMap:XamWebDock.Edge="InsideTop" LayerName="statesLayer"></igMap:MapColorSwatchPane>
   <igMap:MapThumbnailPane Width="200" Height="100" HorizontalAlignment="Center" Margin="0,0,0,10" Background="Transparent" igMap:XamWebDock.Edge="InsideBottom" Style="{StaticResource MapThumbnailStyle}" />
  </igMap:XamWebMap>

private

 

void refreshMap()

{

MSAGV1.FeedService1.

SlotTransactionServiceClient webService = new MSAGV1.FeedService1.SlotTransactionServiceClient();

webService.GetSlotsByIntervalandDatesSPCompleted +=

new EventHandler<GetSlotsByIntervalandDatesSPCompletedEventArgs

>(webService_GetSlotsByIntervalandDatesSPCompleted);

webService.GetSlotsByIntervalandDatesSPAsync();

}

 

 

 

void webService_GetSlotsByIntervalandDatesSPCompleted(object sender, GetSlotsByIntervalandDatesSPCompletedEventArgs e)

{

 

this.floorMap.Layers["statesLayer"].DataSource = e.Result;

 

 

this.floorMap.Layers["statesLayer"].DataBind();

}

 

Parents
No Data
Reply
  • 28496
    Offline posted

    it looks fine to me as long as:

    • you have a file called DemoFloor.dbf which matches DemoFloor.shp and contains a column named "ID"
    • the objects in your datasource have a property called slotnumber which exactly match the values in your "ID" column
    • the objects in your datasource have a numeric property called TotalCashIn

    is all this true?

    take a look at the "world data - gross domestic product" sample for a demonstration of the layer + shapefilereader datamapping.

Children