Hi
At the moment I am using map.ZoomIntoCentre to show a single feature.
How do I zoom in if I have many features and want to zoom in so I can display them all?
Cheers
Steve
Hi
At the moment I am using map.ZoomIntoCentre to show a single feature.
How do I zoom in if I have many features and want to zoom in so I can display them all?
Cheers
Steve
Steve,
Following code is going to set the extent of the map control to some specified features.
winformsMap1.CurrentExtent = ExtentHelper.GetBoundingBoxOfItems(features);
Any more questions just feel free to let me know.
Thanks.
Yale
That works Yale but has thrown up another problem.
I have 20 area style features that I find in other layers, add to an inmemory layer and zoom to extents.
The zoom level is such that I cannot see any of the features. They are too small.
Points seem to be visible when zoomed way out - is there any way I can setup a style so it used area style when zoomed in but point style when zoomed out? Or is there another way to do this?
This is my InMemory layer definition:
private static InMemoryFeatureLayer CreateInMemoryLayer(GeoColor areaBrush, GeoColor otherBrush)
{
InMemoryFeatureLayer inMemoryLayer = new InMemoryFeatureLayer();
inMemoryLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = new AreaStyle(new GeoSolidBrush(areaBrush));
inMemoryLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle.OutlinePen.Color = otherBrush;
inMemoryLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle = PointStyles.CreateSimpleCircleStyle(
otherBrush, 10, GeoColor.StandardColors.Black);
inMemoryLayer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle = LineStyles.CreateSimpleLineStyle(
otherBrush, 8, GeoColor.StandardColors.Black, 1, false);
inMemoryLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
return inMemoryLayer;
}
Cheers
Steve
Steve,
I think what we need to do is to only set PointStyle for those high level zoomlevels and only set AreaStyle for those low level zoomlevels. See following code snippet:
private static InMemoryFeatureLayer CreateInMemoryLayer(GeoColor areaBrush, GeoColor otherBrush)
{
InMemoryFeatureLayer inMemoryLayer = new InMemoryFeatureLayer();
inMemoryLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle = PointStyles.CreateSimpleCircleStyle(otherBrush, 10, GeoColor.StandardColors.Black);
inMemoryLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level06;
inMemoryLayer.ZoomLevelSet.ZoomLevel06.DefaultAreaStyle = new AreaStyle(new GeoSolidBrush(areaBrush));
inMemoryLayer.ZoomLevelSet.ZoomLevel06.DefaultAreaStyle.OutlinePen.Color = otherBrush;
inMemoryLayer.ZoomLevelSet.ZoomLevel06.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
//inMemoryLayer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle = LineStyles.CreateSimpleLineStyle(
// otherBrush, 8, GeoColor.StandardColors.Black, 1, false);
return inMemoryLayer;
}
Any more questions just feel free to let me know.
Thanks.
Yale