We recently switched to the WPF controls from Winforms, and update to 5.0. I'm now having some issues with the default zoom levels. I'm admittedly not an expert in this area; I didn't write our GIS integration originally.
What is happening is the zoom bar doesn't seem to be scaling based on the size of the shapefile. For instance, this is plot map of a cemetary. In an ideal world, when the zoom was completely out, it would be at or just larger than the bounding box of the shapefile. And it would allow me to zoom in essentially as close as possible. But What's happening is that although I set my map's currentExtent = shapefile.GetBoundingBox(), the zoom is already 90% in. So we have almost no leeway when zooming in further:
As you can see I'm just using the CS HowDoISamples project, substituting my own shapefile:
Map1.MapUnit = GeographyUnit.Meter;
ShapeFileFeatureLayer layer = new ShapeFileFeatureLayer(@"J:\common\GISData\SPRINGFIELDCM\Davis_Cemetery_GIS_2-7-2011\Shapefiles\Plot_Boundary.shp");
layer.Open();
Map1.CurrentExtent = layer.GetBoundingBox();
layer.Close();
layer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
layer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.Country1;
layer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle = LineStyles.Canal1;
layer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle = PointStyles.Capital1;
layer.ZoomLevelSet.ZoomLevel01.DefaultTextStyle = TextStyles.Railway1("TextColumnName");
LayerOverlay staticOverlay = new LayerOverlay();
staticOverlay.Layers.Add("delta", layer);
Map1.Overlays.Add(staticOverlay);
Map1.Refresh();
I've also noticed that changing the MapUnit has some minor effect on the zoom levels. Thanks for the help!