Hi Ricardo, No I think that makes sense. A solution would be to A: get the pixel from the new center B: add maybe 20 (or however much your left panel is big) to the x value so the center is moved further right. C: then recenter using get lonlatfrompixel.
One big warning about this (and using pixels in general); this will all break when you use a screen with a different resolution. Toby On 22 Nov 2011, at 14:48, Ricardo Bayley <[email protected]> wrote: > Hi folks, > > I have 2 divs. One is a panel and the other is the map. > The panel slides to the left of my screen and gets hidden. So the map > occupies the entire screen width. > > If both divs are position one next to the other, every time the panel slides > (opening & closing) map div gets resized. > Since I dont like the effect it causes I made by div panel to lay on top of > the map and not next to it. So every time the panel gets hidden or shown, map > doesnt change at all. > > This comes with a cost. When I do => map.setCenter(x,y) I would like to have > it centered to the "visible center" of the map. > So when the panel is visible, the center should be shifted to x pixels to the > right. > > So basically, what I am looking for is to shift coords xpixels to the right. > Ideally it should work to with zoomToExtent. > > Is it confusing ? How should I do this ? > > > warm regards. > > > Ricardo > > > _______________________________________________ > Users mailing list > [email protected] > http://lists.osgeo.org/mailman/listinfo/openlayers-users
_______________________________________________ Users mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/openlayers-users
