disable pinch to zoom

1108
2
08-15-2017 01:18 PM
deleted-user-OlpHy1NoMNug
Occasional Contributor II

On JS 4.xx is it possible to disable the pinch to zoom but keep the panning?  Sample would imply no.

Disable all zooming on the view | ArcGIS API for JavaScript 4.4 

Tags (3)
0 Kudos
2 Replies
ChrisSmith7
Frequent Contributor

I haven't tried this, but based on this thread - Pinch to Zoom - Disable rotation on mobile device 4.3  - it seems like you may want to check out adding a constaint on rotationEnabled. Setting this constraint (rotationEnabled: false) appears to have the side-effect of disabling pinch... which is what you're looking to do.

Now, if this does work, I probably wouldn't rely on it with future versions as it seems like the behavior may change once v4 becomes mature. It seems weird that this would disable pinch (as stated in the thread), but it also seems weird that the API couples pinch zoom and pan with the drag event. It really seems like there needs to be a separate event for multiple input gestures, or something like that.

deleted-user-OlpHy1NoMNug
Occasional Contributor II

Chris, 

Thanks for your reply.  This would work except I need the map to be able to rotate.  In fact, I've applied a rotation of 340 by default.  I wouldn't mind turning rotation off for users but this constraint is overriding the 340 rotation setting.

However, I did notice a constraint (snapToZoom) which restricts scales to specific LOD which is actually what I'm looking for.  Unfortunately, it doesn't seem to be honored on mobile.  Any thoughts?

Scott 

0 Kudos