I have a trackbar on my window to allow users to customize the zoom level. The middle point of the trackbar is the default zoom level, which is approximately zoom level 20.
The map is configured to not snap to the zoom level.
I would like to specify custom scales at each tick on the trackbar. I calculate each zoom level by dividing the scale for zoom level 20 by 2. When the trackbar moves to that tick, I set the CurrentScale property to match the value I calculate for the tick.
Further, if the user changes the zoom level using the mousewheel or zoom-to, I try to calculate the current scale to see which scale they've zoomed to, and adjust the trackbar setting accordingly.
The problem arises that I can try to set the CurrentScale to my calculated value but the CurrentScale won't change. For example, I can set the CurrentScale to 141 but the map scale never adjusts to that value.
What's the best way to calculate the zoom levels (beyond 20) and ensure that the mousewheel and zoom-to behavior matches my zoom levels?