[OpenLayers-Dev] OpenLayers within scrollable pane?

Christopher Schmidt crschmidt at metacarta.com
Thu Apr 23 11:57:16 EDT 2009

On Thu, Apr 23, 2009 at 11:32:55AM -0400, ashley_c_mort wrote:
> Hello all.  I am relatively new to OpenLayers and have a quick question.
> I have an OpenLayers map within a page that contains scrollbars.  If I
> scroll within my webpage, my OpenLayers getMousePosition() XY coordinates
> are off by the amount that I scrolled.  Is there an OpenLayers solution/fix
> for this?  Or is the solution just to keep the OpenLayers map within a
> container with no scrollbars at all times?

call map.updateSize() on the map after the pane is scrolled, perhaps? We
may only look at scroll distances at the document level; I don't recall
looking into this issue on sub-panes before.

Christopher Schmidt

More information about the Dev mailing list