axMap.ZoomIn not working

Hi all,

I’m playing around with map scales and zoom and in the process I created two buttons:

ZoomIn and ZoomOut executing relatively the axMap.ZoomIn and axMap.ZoomOut commands.

My problem is that both of them results in a zoomOUT. That is the map is getting smaller!?

Am I missing something completely?

Please note that I change the default ZoomBehavior.

Bonus question: Is there another way that I can set up, for example, a list of map scales make the map jump between those on zooming?

My code (Or relevant parts of it):
axMap.ZoomBehavior = tkZoomBehavior.zbDefault;

    private void btnZoomIn_Click(object sender, EventArgs e)
    {
        Debug.Print("Zooming in " + ZoomPct + "%");
        axMap.ZoomIn(ZoomPct);
    }

    private void btnZoomOut_Click(object sender, EventArgs e)
    {
        Debug.Print("Zooming out " + ZoomPct + "%");
        axMap.ZoomOut(ZoomPct);
    }

Regards,
Henrik

Hello @HenrikKartin

Is your ZoomPct constant a value between zero and 1?

To zoom in / out by 20%, you should specify 0.2.

Regards.

Thanks Jerry

That works!

I assumed that 20% was 20 and not 0.2.

It’s a natural assumption. I will update the documentation to make it clear.

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.