Select to view content in your preferred language

Override out-of-box rectangle zoom

489
3
Jump to solution
09-15-2022 05:41 AM
mallynaihabi
Emerging Contributor

Can i override out-of-box operation of press down shift key and click on map then rectangle will appear and will zoom to that extent? or what event that handle the opeation?

i want to be able to select graphics within the rectangle.

i put a breakpoint in GeoViewTapped but will not stop there if a shift key is pressed down.

thanks.

0 Kudos
1 Solution

Accepted Solutions
dotMorten_esri
Esri Notable Contributor

There's no out of the box support for this. If you're using WPF you might be able to override the left mouse button down preview event, and if shift is pressed, set Handled=true on the event argument. That should prevent the mapview from doing anything with the event, and you can then do your own draw box code in the down/drag/up events.

View solution in original post

0 Kudos
3 Replies
dotMorten_esri
Esri Notable Contributor

There's no out of the box support for this. If you're using WPF you might be able to override the left mouse button down preview event, and if shift is pressed, set Handled=true on the event argument. That should prevent the mapview from doing anything with the event, and you can then do your own draw box code in the down/drag/up events.

0 Kudos
mallynaihabi
Emerging Contributor

so i can't override the out of the box operation that already there which will zoom to extent?

 

0 Kudos
dotMorten_esri
Esri Notable Contributor

Sort of. If you're using WPF you can definitely turn off the zoom box gesture completely and do your own thing (which would have to include drawing your own box). But no there's no way to repurpose the existing box that is drawn to do something other than zoom.

0 Kudos