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.

see http://dev.openlayers.org/docs/files/openlayers/handler/path-js.html#openlayers.handler.path.freehandtoggle

drawfeaturecontrol.handler.freehandtoggle = null; trick. reset 'shiftkey' if want re-enable it.


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -