[OpenLayers-Users] IE registers click postion with an offset to the left

Nico Mandery nico.mandery at geops.de
Mon Mar 9 05:00:41 EDT 2009


Hello list,

I am using a clickhandler to recieve events when a user clicks at some
point in the map. Inside the registered callback I use the method
getLonLatFromViewPortPx of the map to get the coordinates from the
pixel-coordinates associated with the event (Event.xy).

This works great in Firefox, but when testing with IE I noticed an
pretty big offset to the left of the recieved position.  Firefox for
example registers the correct value of X=290 pixels, but with IE its
-820 pixels. The Y-position is the same with both browsers.

The map is located inside some nested divs, may that cause the problem?
There are also some "float:left" CSS attributes on a few of the outer DIVs.

thanks a lot,
nico




More information about the Users mailing list