ThinkGeo.com    |     Documentation    |     Premium Support

I have to create a zoomslider in winform desktop like wpf

Dear all,

I have to create a zoomslider in winform desktop like wpf .

Hi Palani,

Do you means the track zoom bar default in the left of map?

The other user tried to build a track zoom bar for the desktop edition before, but failed because the background image cannot really get transparent, so it looks bad.

If you want to build a custom track zoom bar in desktop edition, I think you can choose some other style which don’t need transparent background. In fact it’s a custom control, call map to zoom in/out by the slider move event, you just need to calculate the slider position and calculate its zoomlevel, then set the scale to our map. And when our map zoom in/out, you can also get the scale changed in ScaleChanged event, and you need reset the slider position.

If you met some other question when implement that please let us know.

Regards,

Don

Dear Don,

I have created the custom zoom slider as you said the same way, but i am stopped at certain point of veiw.

ForExample : If user is mouse wheel zoom in zoom out (or) Shift Mouse draw then map is extent is changed on the time how to calculate the how much previous scale up or dowm value to current scale value . This is my problem.

Thanks
Palani

Hi Palani,

Our map have a concept named ZoomLevel, one zoomlevel corresponding one special scale value, general our map contains 20 zoomlevels, so your slider should only have 20 positions. That means you have a group of 20 scale values.

When you get the current scale after ScaleChanged event, you can find which zoomlevel it should be, then you can set the slider position.

Wish that’s helpful.

Regards,

Don