controls - OpenLayers: How to disable the shift key or freehand mode for DrawFeature -
i disable shift key or freehand mode drawfeature control. typical code looks that:
var drawoptions = {handleroptions: {freehand: true}}; drawfeaturecontrol = new openlayers.control.drawfeature(linelayer, openlayers.handler.path, drawoptions); map.addcontrol(drawfeaturecontrol); there option switch freehand on. there nothing totally deactivate it. every time hit shift freehand mode used.
in use case use shift key behaviour.
drawfeaturecontrol.handler.freehandtoggle = null; trick. reset 'shiftkey' if want re-enable it.
Comments
Post a Comment