Select to view content in your preferred language

Stop Panning when zoom with mouse

648
4
05-27-2010 01:31 PM
centuitcentuit
Emerging Contributor
Hi,

Is there a way to stop panning to the cursor when a user uses the mouse wheel to zoom ?
Currently in V2 Beta and in previous versions when a user uses the mouse wheel to zoom, the map
shifts/pans the cursor when zooming.

Please advise,
Thanks
0 Kudos
4 Replies
dotMorten_esri
Esri Notable Contributor
I'm not sure I understand the problem. When you zoom, the mouse zooms around where the mouse cursor is (ie. if you hold the mouse on top of a city and zoom, the city will stay under the mouse cursor). There shouldn't be any panning involved.
0 Kudos
centuitcentuit
Emerging Contributor
You are right, the perception is that it pans. However, I would like to have the mouse wheel zooming behave just like the Navigation control zoom slider. Can this be accomplished ? is so, can you provide a small example or guide me where to look for it.

Thanks
0 Kudos
dotMorten_esri
Esri Notable Contributor
Sorry. The zooming behavior is by design. You might be able to intercept the mousewheel zoom and cancel it so it doesn't bubbles to the map. You can then do the Zoom call yourself.
0 Kudos
centuitcentuit
Emerging Contributor
Morten,

Thanks for the reply, however I found what I was looking for by using

      <i:Interaction.Behaviors>
                <esriBehaviors:MaintainExtentBehavior />
      </i:Interaction.Behaviors>

which does does the same type of zomming as if I would use the navigation slider.

Thanks again.
0 Kudos