[OpenLayers-Users] Layers out of sync on resize

Tom Blackmore tom.blackmore at arctictiger.se
Fri Apr 13 06:49:06 EDT 2012


Hello all,

I'm have a map with a baselayer and two vector layers. When I resize
the map so it is smaller than the opening browser size the layers
become out of sync with the base layer in the east - west direction.
They retain the correct North coordinates irrespective of resizing.

I've been trying the redraw method or reentering the map on resize but
I just can't get it to work.

The kind of code I've been trying wired to the Browser resize events
are like this:

olMap.updateSize();
if(baseLayer){
   baseLayer.redraw();
   vectorLayer.redraw();
   markerLayer.redraw();
}

I've also tried programatically recentering the map on resize. The
functions definately trigger but don't solve the problem.

Any suggestions?

Thanks in advance for any help

Kind regards

Tom

-- 
Tom Blackmore
www.arctictiger.se

Västerkvarnsvägen 7,
73493 Kolbäck
Tfn. 073-8413456


More information about the Users mailing list