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

Nico Mandery nico.mandery at geops.de
Mon Mar 9 08:26:46 EDT 2009


Hi Christopher,

I just found that the problem was caused by a "position: relative;" on
an outer Div - so its not directly related to OpenLayers at all.

I will keep your hint in mind for when I enconter another issue.

thanks,
nico


Christopher Schmidt schrieb:
> On Mon, Mar 09, 2009 at 10:00:41AM +0100, Nico Mandery wrote:
>> 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.
> 
> The only way to hellp debug this is by sharing your HTML code,
> preferably with as little code as possibe. (See
> http://trac.openlayers.org/wiki/GettingHelp#TipsforgettingHelp)
> 
> -- Chris
> 
>> thanks a lot,
>> nico
>>
>> _______________________________________________
>> Users mailing list
>> Users at openlayers.org
>> http://openlayers.org/mailman/listinfo/users
> 



More information about the Users mailing list