[OpenLayers-Users] DragBox interactions for Touch Screens

Peter Borissow peter.borissow at yahoo.com
Wed Apr 8 12:13:46 PDT 2020


Hello,    I am in the process of upgrading a system from OpenLayers 5.x to 6.x. The only issue I've run into so far has to do with a hack I implemented some time ago to enable the DragBox interaction on touchscreen devices. My hack relied on the  ol.interaction.DragBox.handleEvent function which is no longer around. The code is below. Any suggestions of how to enable  DragBox interaction on touchscreen devices in the 6.x series?

        var _handleEvent = ol.interaction.DragBox.handleEvent;
        if (_handleEvent){
            dragBox.handleEvent = function(e) {
                if (e.pointerEvent && e.pointerEvent.pointerType === 'touch') {
                    e.pointerEvent.pointerType = 'mouse';
                }
                return _handleEvent.apply(this, arguments);
            };
        }
        else{
            //???
        }


Thanks,Peter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20200408/c21fc8d1/attachment.html>


More information about the Users mailing list