[OpenLayers-Users] Re: SelectFeature - prevent double click

geoman csabbey at gmail.com
Thu Nov 17 10:12:03 EST 2011


I didn't see a clean way of doing it - I ended up using a hack:

		var control =
this.map.getControlsByClass("OpenLayers.Control.Navigation")[0],
			enabledDblClick;
		if (control) {
			// this is dependent on OpenLayers internals, 
			//   but simply deactivating and reactivating the control prevented
feature selection
			enabledDblClick = control.handlers.click.callbacks.dblclick;
			control.handlers.click.callbacks.dblclick = function (event) { 
				return; 
			};
			setTimeout(function () {
				control.handlers.click.callbacks.dblclick = enabledDblClick;
			}, 250);
		}		

If someone has a better approach, I'd love to hear it.

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/SelectFeature-prevent-double-click-tp6994368p7004420.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.


More information about the Users mailing list