- return false;
- });
-
- if ($("#query").val()) {
- $("#search_form").submit();
- }
-
- // Focus the search field for browsers that don't support
- // the HTML5 'autofocus' attribute
- if (!("autofocus" in document.createElement("input"))) {
- $("#query").focus();
- }
-});
-
-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);
- }