Hello,
I've tried to load some of my shp files created with ESRI ArcMap with MapSuiteWPF but nothing is displayed. Here my code:
private void Window_Loaded(object sender, RoutedEventArgs e)
{
// Set the Map Unit. The reason for setting it to DecimalDegrees is that is what the shapefile’s unit of measure is inherently in.
Map1.MapUnit = GeographyUnit.DecimalDegree;
ShapeFileFeatureSource.BuildIndexFile(@"D:\MapSuiteTest\Karten\FluesseBelgien.shp");
// We create a new Layer and pass the path to a Shapefile into its constructor.
ShapeFileFeatureLayer worldLayer = new ShapeFileFeatureLayer(@"D:\MapSuiteTest\Karten\FluesseBelgien.shp");
// Set the worldLayer with a preset Style, as AreaStyles.Country1 has YellowGreen background and black border, our worldLayer will have the same render style.
worldLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.Country1;
// This setting will apply from ZoonLevel01 to ZoomLevel20, that means we can see the world the same style with ZoomLevel01 all the time no matter how far we zoom out/in.
worldLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
// Create a new Layer Overlay to hold the layer we just created
LayerOverlay layerOverlay = new LayerOverlay();
// Add a background Layer
layerOverlay.Layers.Add(new BackgroundLayer(new GeoSolidBrush(GeoColor.GeographicColors.ShallowOcean)));
// Add the shapefile layer to the layer overlay
layerOverlay.Layers.Add(worldLayer);
// We need to add the layerOverlay to map.
Map1.Overlays.Add(layerOverlay);
// Set a proper extent for the Map.
//Map1.CurrentExtent = new RectangleShape(0, 78, 30, 26);
// We now need to call the Refresh() method of the Map control so that the Map can redraw based on the data that has been provided.
Map1.Refresh();
}
The shp file I want to display is attached.
Any idea what's goining wrong?
Thanks in advance.
FluesseBelgien.zip (26.7 KB)