[OpenLayers-Dev] problem with updateSize

Bart van den Eijnden (OSGIS) bartvde at osgis.nl
Wed Dec 12 07:11:35 EST 2007

Hi list,

we've encountered a potential problem with updateSize in OL 2.5.

The updateSize function causes all invisible baselayers to request an image
from their WMS service. At least for WMS untiled, I haven't checked other

I've created an example which can be used to reproduce, the easiest is to
watch the Net console of Firebug.

<html xmlns="http://www.w3.org/1999/xhtml">
    <style type="text/css">
        #map {
            width: 400px;
            height: 500px;
            border: 1px solid black;
    <script src="../lib/OpenLayers.js"></script>
    <script type="text/javascript">
        var map;

        function resize() {
          document.getElementById('map').style.width = '600px';
          document.getElementById('map').style.height = '800px';

        function init(){
          OpenLayers.DOTS_PER_INCH = 90.714;
          map = new OpenLayers.Map( 'map', { 'projection': 'EPSG:28992',
'units':'m', 'maxExtent': new
OpenLayers.Bounds(0,300000,300000,600000),'scales': [2000000, 1500000,
1000000, 750000, 500000, 375000, 250000, 100000, 50000, 25000, 10000, 5000,
2500, 1000]});

          var layer = new OpenLayers.Layer.WMS( "Provincies",
{layers: 'NL-prov,bebouwing', 'format':'image/gif', 'transparent':'TRUE'},
{'ratio':1, singleTile: true, isBaseLayer: true} );

          var layer = new OpenLayers.Layer.WMS( "Dijkringgebieden",
{layers: 'AAA205', 'format':'image/gif', 'transparent':'TRUE'}, {'ratio':1,
singleTile: true, isBaseLayer: true, visibility: false} );
          if (!map.getCenter()) map.zoomToMaxExtent();

           map.addControl( new OpenLayers.Control.LayerSwitcher() );
  <a href="javascript:resize()">Resize</a>
  <body onload="init()">
    <div id="map"></div>


Best regards,

Bart van den Eijnden
OSGIS, Open Source GIS

More information about the Dev mailing list