X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/9bcd049c98eb09e0b822710448e64dd5c266c498..42fa563e01493fd7a6e28d8053f84558e50d5322:/app/assets/javascripts/index.js diff --git a/app/assets/javascripts/index.js b/app/assets/javascripts/index.js index a19a6a61e..5f6a4efb7 100644 --- a/app/assets/javascripts/index.js +++ b/app/assets/javascripts/index.js @@ -53,10 +53,14 @@ $(document).ready(function () { function updateLayers(params) { var layerParam = params.layers || "M"; + var layersAdded = ""; for (var i = layers.length - 1; i >= 0; i--) { if (layerParam.indexOf(layers[i].options.code) >= 0) { map.addLayer(layers[i]); + layersAdded = layersAdded + layers[i].options.code; + } else if (i == 0 && layersAdded == "") { + map.addLayer(layers[i]); } else { map.removeLayer(layers[i]); }