Skip to main content
improved formatting
Source Link
John Powell
  • 12.5k
  • 6
  • 62
  • 69

The above answer is correct, but you will have to explicitly add this control to the map to override the default Navigation control, ie,

var Navigation = new OpenLayers.Control.Navigation({
  defaultDblClick: function(event) { return; }
});

map.addControl(Navigation);

The following controls are added by default to an OpenLayers.Map: OpenLayers.Control.Navigation, OpenLayers.Control.PanZoom, OpenLayers.Control.ArgParser, OpenLayers.Control.Attribution

So another option if you want to turn all these default behaviors off, is to send an empty array in the options parameter of the open layers map constructor, see link text for more details.

The above answer is correct, but you will have to explicitly add this control to the map to override the default Navigation control, ie,

var Navigation = new OpenLayers.Control.Navigation({
defaultDblClick: function(event) { return; }
});

map.addControl(Navigation);

The following controls are added by default to an OpenLayers.Map: OpenLayers.Control.Navigation, OpenLayers.Control.PanZoom, OpenLayers.Control.ArgParser, OpenLayers.Control.Attribution

So another option if you want to turn all these default behaviors off, is to send an empty array in the options parameter of the open layers constructor, see link text for more details.

The above answer is correct, but you will have to explicitly add this control to the map to override the default Navigation control, ie,

var Navigation = new OpenLayers.Control.Navigation({
  defaultDblClick: function(event) { return; }
});

map.addControl(Navigation);

The following controls are added by default to an OpenLayers.Map: OpenLayers.Control.Navigation, OpenLayers.Control.PanZoom, OpenLayers.Control.ArgParser, OpenLayers.Control.Attribution

So another option if you want to turn all these default behaviors off, is to send an empty array in the options parameter of the open layers map constructor, see link text for more details.

Source Link
John Powell
  • 12.5k
  • 6
  • 62
  • 69

The above answer is correct, but you will have to explicitly add this control to the map to override the default Navigation control, ie,

var Navigation = new OpenLayers.Control.Navigation({
defaultDblClick: function(event) { return; }
});

map.addControl(Navigation);

The following controls are added by default to an OpenLayers.Map: OpenLayers.Control.Navigation, OpenLayers.Control.PanZoom, OpenLayers.Control.ArgParser, OpenLayers.Control.Attribution

So another option if you want to turn all these default behaviors off, is to send an empty array in the options parameter of the open layers constructor, see link text for more details.