<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#ffffff" text="#000000">
Hello list, anyone know how to get a Button control added to the map to
consume and ignore double click events? I want to let the normal
handling of double click events (ie the zooming) work if the user
double clicks on the map normally. Also I would prefer not to have to
patch OpenLayers if at all possible. Here's my code:<br>
<br>
<pre style="font-family: consolas;"> <span style="color: blue;">var</span> extentControl = <span
style="color: blue;">new</span> OpenLayers.Control.Button({
displayClass: <span style="color: maroon;">'olControlZoomToMaxExtent'</span>,
title: <span style="color: maroon;">"Zoom to extent of site"</span>,
trigger: <span style="color: blue;">function</span> () {
map.zoomToExtent(sitesLayer.getDataExtent());
}
});
<span style="color: blue;">var</span> controls = [
// other controls also added to this list
<span style="color: blue;"></span>
extentControl
];
<span style="color: blue;">var</span> panel = <span
style="color: blue;">new</span> OpenLayers.Control.Panel({
<span style="color: maroon;">'displayClass'</span>: <span
style="color: maroon;">'olCustom'</span>,
defaultControl: controls[0]
});</pre>
<title>Snippet</title>
<pre style="font-family: consolas;">panel.addControls(controls);
map.addControl(panel);</pre>
</body>
</html>