ThinkGeo.com    |     Documentation    |     Premium Support

Map.ZoomIn not working

Is there a bug with Map.ZoomIn? Currently trying to simply use Map.ZoomIn, but regardless of what number I pass it, it doesn’t work. Map.ZoomOut works fine. My code is simply:

if (x > 0)
{
    Map.ZoomIn(x); //doesn't work
}
else
{
    x = Math.Abs(x);
    Map.ZoomOut(x); //works
}

Map.Refresh();

Thanks!

Hi Dan,

Please let us know the X value, if the value is small, because we have snap mode, it still will leave in original level.

Regards,

Ethan

I’ve tried a lot of numbers. From what I can tell, everything from 1 to 49 does not work with ZoomIn. From 50 to to 99 it does work. For ZoomOut, every number works.

What is snap mode? I just want the current ZoomIn / ZoomOut functions to do what their method descriptions say: “This method will zoom in/out the currentExtent by the percentage provided.”

Thanks!

Think I fixed it. I did the following:

Map.ZoomLevelSnapping = ZoomLevelSnappingMode.None;

Is there anything I should know about changing this? Can it cause any problems?

Thanks!

Hi Dan,

If you set this property, when you zoom in and zoom out, the map won’t automatic snap to the default zoomlevel.

I don’t know your detail scenario, so I am not sure whether it cause any problem for your map, but I think you can try it now.

Regards,

Ethan