- Fixed visibility of mapkey.

- Changed https to http request for openstreetmap (https not supported)
This commit is contained in:
Kasper D. Fischer 2013-03-20 09:15:01 +00:00
parent 7bae1d37b4
commit cb29b26052
Notes: subgit 2018-03-07 17:58:40 +01:00
r491 www/trunk

View File

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