Hello,

I'm trying to write some code to remove all the overlays (so I can add a
fresh bunch). I've got the following function:

function kill_overlays() {
  for (lyr_name in map.layers) {
    lyr = map.layers[lyr_name];
    if (!lyr.isBaseLayer) {
      map.removeLayer(lyr);
    }
  }
}

But strangely, it doesn't remove all the layers. If you call it several
times over it eventually removed the lot. Can anyone see the problem? You
can play with a live test here:
http://www.openecomaps.co.uk/map_test.html

Any help much appreciated.

Tom

-- 
http://tom.acrewoods.net   http://twitter.com/tom_chance
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users

Reply via email to