ThinkGeo.com    |     Documentation    |     Premium Support

V12.1 - Zoom In/Out Behavior after Initial Rendering

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

Thanks Dennis,
I still can not reproduce the issue. I created a simple sample for you. Could you modify the sample to help us reproduce the issue.
Demo.zip (83.5 KB)

If you have data need upload. Could you please create a private support ticket. and upload the files.

Thanks

Frank

hi Frank,

I looked at your example and it is not the same as my code.

I’m invoking ZoomTo, in the example it simply sets CurrentExtent.

Setting CurrentExtent to a predefined known value works in my application.

The point is that I do not have a predefined known extent. I have a predefined Lat/Long.

Dennis

Thanks Dennis,
I got it. I can reproduce this issue now. Looks like the map.ZoomTo method will zoom to where you want. But it not save the new extent. We are looking into the detail. Right now the workaround you are doing looks good. We will let you know once this get fixed.

Thanks

Frank

You’re very welcome Frank.

Whenever you have a fix let me know and I can test it.

Dennis

Thanks Dennis,
We will let you know once it available in the prod release.

Thanks

Frank

Hi Dennis,
We have this issue fixed in version 12.3.5.
Thanks,
Jack