There is a DragRotateAndZoom example:
https://openlayers.org/en/latest/examples/drag-rotate-and-zoom.html

Take this and replace DragRotateAndZoom with DragZoom passing {condition: () => true} in the constructor:

|defaultInteractions().extend([new DragZoom(||{condition: () => true})])|


condition function gets called to decide if it should process the event - in your case it should always return true.

On 12/01/2022 20:13, karsten wrote:
Hi All,
in OL 6 I would like to use a button so a user can click activate a change for the dragzoom control
so it will be available without holding down shift.
In https://openlayers.org/en/latest/apidoc/module-ol_interaction_DragZoom-DragZoom.html <https://openlayers.org/en/latest/apidoc/module-ol_interaction_DragZoom-DragZoom.html>it lists the option 'condition' to handles this. I could not figure out how to change and set that condition . Any examples how to do this?
Thanks
Karsten

Terra GIS LTD
www.terragis.net <http://www.terragis.net>

_______________________________________________
Users mailing list
us...@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/openlayers-users


--
Cordialement,
Momtchil Momtchev<momtc...@momtchev.com>
_______________________________________________
Users mailing list
us...@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/openlayers-users

Reply via email to