I found a Christopher's answser on 4/23/09 to a similar problem; basically you just register a function on the "onscroll" event of the scrolled pane an call map.updateSize(); It works for me, let me know if it's the same for you. Thank's a lot to Chris...
- Show quoted text - 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. On Tue, Dec 29, 2009 at 2:28 PM, Ringdahl Niklas <niklas.ringd...@sweco.se>wrote: > I am also experiencing an issue that sounds like yours. I am using a UI > framework (JSF) that opens the map in a floating div (imitating a window), > and when the underlying page is scrolled, the zoom box appears below the > mouse pointer. I realized recently that the distance is equal to the amount > of scrolled pixels, as if the map object believes that is being scrolled > down with the page. > > The problem can be caused by the mixing of javascript and css libraries, of > course, but if anyone has a neat little trick to solve this, that would be > highly appreciated. > > Thanks! > - Niklas > > > ------------------------------ > *Från:* dev-boun...@openlayers.org [mailto:dev-boun...@openlayers.org] *För > *Gianni Barrotta > *Skickat:* den 23 december 2009 18:45 > *Till:* Dev@openlayers.org > *Ämne:* [OpenLayers-Dev] Probable draw issue > > Hi, > I've experienced a problem when the Map is inside a div whoose css style > have a "overflow-y:auto" property. > > *<div style="height:600px;overflow-y:auto;"> > <div id="map"></div> > </div>* > > If I scrooll down the div with the overflow, the bbox (and the draw > controls too) appears to be shifted down of the number of pixel of the > scrollbar. > Does anyone experienced something like this? > Thank's. >
_______________________________________________ Dev mailing list Dev@openlayers.org http://openlayers.org/mailman/listinfo/dev