Disable Manual Zoom

Is there a way to prevent users from zooming in on the map? I want them to be able to pan the map, but not zoom or tilt. I’m going to build my own zoom controls using Web SDK version 5.

Hiya BerryFun!

If I’m understanding correctly - are you looking to disable two finger gestures (so it prevents zoom / rotation / tilt) and just allow the one figure gesture to pan the map?

If yes, then that can be done by setting TCameraInteractionsSetOptions so that rotationAndTilt and zoom are disabled, and pan is enabled.

This will keep the single finger gesture to pan enabled.

Here’s a code sample that does just that:

mapView.Camera.interactions.set({
  zoom: false,
  rotationAndTilt: false,
  pan: true,
});

Hope that helps!

Woo, thanks! I have this working now.

2 Likes