[OpenLayers-Users] strange click events with internet explorer

Christian Sengstock csengstock at gmail.com
Thu May 31 05:00:08 EDT 2007


hi list,
i extended the OpenLayers.Control.MouseToolbar with a new button
takeing click events to create a new overlay in the map on the given
point.

I get the position like this:

OpenLayers.Control.MouseToolbar.prototype = ...
...
defaultMouseDown: function(evt) {
...
var lonlat = this.map.getLonLatFromViewPortPx(evt.xy);
// using these lonlat to create overlays.
...
}



This works fine for Firefox. With InternetExplorer however the click
event (evt.xy) returns the wrong location. It seem like the offset of
the map div element is not substracted from the xy pixel. The same
problems occurs for the "zoombox" which is already implemented as a
functionality in the MouseToolbar.

Is this a known problem and is there maybe a workaround? I think the
problem depends on where the map div is located in the DOM, because it
worked properly when i tested the MouseToolbar with a very basic html
page (just the map div).



More information about the Users mailing list