+function getMapLayers() {
+ var layers = "";
+
+ for (var i=0; i< this.map.layers.length; i++) {
+ var layer = this.map.layers[i];
+
+ if (layer.isBaseLayer) {
+ layers += (layer == this.map.baseLayer) ? "B" : "0";
+ } else {
+ layers += (layer.getVisibility()) ? "T" : "F";
+ }
+ }
+
+ return layers;
+}
+
+function setMapLayers(layers) {
+ for (var i=0; i < layers.length; i++) {
+ var layer = map.layers[i];
+ var c = layers.charAt(i);
+
+ if (c == "B") {
+ map.setBaseLayer(layer);
+ } else if ( (c == "T") || (c == "F") ) {
+ layer.setVisibility(c == "T");
+ }
+ }
+}
+