+
+function getMapBaseLayer() {
+ for (var i = 0; i < layers.length; i++) {
+ if (map.hasLayer(layers[i].layer)) {
+ return layers[i];
+ }
+ }
+}
+
+function getMapLayers() {
+ var layerConfig = "";
+ for (var i = 0; i < layers.length; i++) {
+ if (map.hasLayer(layers[i].layer)) {
+ layerConfig += layers[i].layerCode;
+ }
+ }
+ return layerConfig;
+}
+
+function setMapLayers(layerConfig) {
+ var foundLayer = false;
+ for (var i = 0; i < layers.length; i++) {
+ if (layerConfig.indexOf(layers[i].layerCode) >= 0) {
+ map.addLayer(layers[i].layer);
+ foundLayer = true;
+ } else {
+ map.removeLayer(layers[i].layer);
+ }
+ }
+ if (!foundLayer) {
+ map.addLayer(layers[0].layer);
+ }
+}