diff --git a/station_map_www.js b/station_map_www.js index 43dd57e..a8ca957 100644 --- a/station_map_www.js +++ b/station_map_www.js @@ -71,9 +71,9 @@ function init(showGoogle, showStations, showQuakes, noFrils) { var osmde_map_layer = new OpenLayers.Layer.OSM( 'OpenStreetMap (DE)', [ - "https://a.tile.openstreetmap.de/tiles/osmde/${z}/${x}/${y}.png", - "https://b.tile.openstreetmap.de/tiles/osmde/${z}/${x}/${y}.png", - "https://c.tile.openstreetmap.de/tiles/osmde/${z}/${x}/${y}.png" + "http://a.tile.openstreetmap.de/tiles/osmde/${z}/${x}/${y}.png", + "http://b.tile.openstreetmap.de/tiles/osmde/${z}/${x}/${y}.png", + "http://c.tile.openstreetmap.de/tiles/osmde/${z}/${x}/${y}.png" ], { attribution: 'Geobasisdaten: Copyright © 2013 OpenStreetMap und Mitwirkende;' + @@ -126,7 +126,8 @@ function init(showGoogle, showStations, showQuakes, noFrils) { // Show quakes quakes_layer = loadKML(OpenLayers.i18n("Events"), 'quakes.kml', false, true); - quakes_layer.events.on({'visibilitychanged': toggleQuakesMapkey}); + quakes_layer.events.on({'loadend': setQuakesMapkeyVisibility}); + quakes_layer.events.on({'visibilitychanged': setQuakesMapkeyVisibility}); map.addLayer(quakes_layer); quakes_layer.setVisibility(showQuakes); @@ -219,9 +220,9 @@ function init(showGoogle, showStations, showQuakes, noFrils) { } // Enable animated zoom - for (var i=map.layers.length-1; i>=0; --i) { - map.layers[i].animationEnabled = true; - } + // for (var i=map.layers.length-1; i>=0; --i) { + // map.layers[i].animationEnabled = true; + //} // Show description select = new OpenLayers.Control.SelectFeature([quakes_layer, stations_layer]); @@ -336,12 +337,14 @@ function onFeatureUnselect(event) { } /* Function to activate map legend */ -function toggleQuakesMapkey() { +function setQuakesMapkeyVisibility() { var mapkey_div = document.getElementById('mapkey'); var quakes_visibility = quakes_layer.getVisibility(); if (quakes_visibility) { mapkey_div.style.display = "block"; + mapkey_div.style.visibility = "visible"; } else { mapkey_div.style.display = "none"; + mapkey_div.style.visibility = "hidden"; } }