ThinkGeo Team,
Have encountered invalid behavior on Zoom In/Out that is not an issue in earlier versions.
The code below results in the following behaviors:
Display map with ZoomLevel17 as initial ZoomLevel.
ZoomOut one level and resulting level is ZoomLevel11.
From this point ZoomIn/ZoomOut works properly.
Display map with ZoomLevel17 as initial ZoomLevel.
ZoomIn one level and resulting level is ZoomLevel13.
From this point ZoomIn/ZoomOut works properly.
Display map with ZoomLevel17 as initial ZoomLevel.
Pan the map.
Zoom In/Out works properly.
// instantiate layer
MrSidLayer = new MrSidRasterLayer();
MrSidLayer.ImagePath = ThePath;
// load raster
TheAssetsStatic.aTheLayerOverlay.Layers.Add(MrSidLayer);
// set CurrentExtent based on all Layers
TheAssetsStatic.aMapView.CurrentExtent = TheAssetsStatic.aTheLayerOverlay.GetBoundingBox();
// get CenterPoint of BoundingBox
TheCenterPoint = TheAssetsStatic.aMapView.CurrentExtent.GetCenterPoint();
// ZoomTo and Center
TheAssetsStatic.aMapView.ZoomTo(TheCenterPoint, TheAssetsStatic.aMapView.ZoomLevelSet.ZoomLevel17.Scale);
// Refresh to set MapView.CurrentExtent
TheAssetsStatic.aMapView.Refresh();
With the following code Zoom In/Out works as it should:
// instantiate layer
MrSidLayer = new MrSidRasterLayer();
MrSidLayer.ImagePath = ThePath;
// load raster
TheAssetsStatic.aTheLayerOverlay.Layers.Add(MrSidLayer);
// set CurrentExtent based on all Layers
TheAssetsStatic.aMapView.CurrentExtent = TheAssetsStatic.aTheLayerOverlay.GetBoundingBox();
// get CenterPoint of BoundingBox
TheCenterPoint = TheAssetsStatic.aMapView.CurrentExtent.GetCenterPoint();
// ZoomTo and Center
TheAssetsStatic.aMapView.ZoomTo(TheCenterPoint, TheAssetsStatic.aMapView.ZoomLevelSet.ZoomLevel17.Scale);
// Refresh to set MapView.CurrentExtent
TheAssetsStatic.aMapView.Refresh();
// after Refresh need to get newly calculated CurrentExtent
TheUpperLeftPoint = TheAssetsStatic.aMapView.CurrentExtent.UpperLeftPoint;
TheLowerRightPoint = TheAssetsStatic.aMapView.CurrentExtent.LowerRightPoint;
// set CurrentExtent based on CurrentExtent determined by above ZoomTo
TheCurrentExtent = new RectangleShape(TheUpperLeftPoint, TheLowerRightPoint);
TheAssetsStatic.aMapView.CurrentExtent = TheCurrentExtent;
// Refresh once again just for good-measure
TheAssetsStatic.aMapView.Refresh();
Would appear that something is not being set somewhere in MapView on the ZoomTo invocation.
Below are screen-captures to help illustrate the issue.
Regards,
Dennis
Initial Map Rendering at ZoomLevel17
Map Following ZoomOut
Map Following ZoomIn