Difference between revisions of "Test"

From A.P.E.S. wiki
Jump to navigation Jump to search
Line 24: Line 24:
 
var map = L.map('map').setView([10, 5], 4);  
 
var map = L.map('map').setView([10, 5], 4);  
  
 +
var osm=new L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png',{
 +
attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'}).addTo(map);
 
var osm=new L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png',{  
 
var osm=new L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png',{  
 
attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'}).addTo(map);
 
attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'}).addTo(map);
Line 39: Line 41:
 
     };
 
     };
 
}
 
}
var highlight = {
+
// var highlight = {
'fillColor': 'yellow',
+
// 'fillColor': 'yellow',
'weight': 2,
+
// 'weight': 2,
'opacity': 1
+
// 'opacity': 1
};
+
// };
 
 
 
function forEachFeature(feature, layer) {
 
function forEachFeature(feature, layer) {
Line 51: Line 53:
 
             layer.bindPopup(popupContent);
 
             layer.bindPopup(popupContent);
  
             layer.on("click", function (e) {  
+
             // layer.on("click", function (e) {  
                 stateLayer.setStyle(style); //resets layer colors
+
                 // stateLayer.setStyle(style); //resets layer colors
                 layer.setStyle(highlight);  //highlights selected.
+
                 // layer.setStyle(highlight);  //highlights selected.
             });  
+
             // });  
 
}
 
}
 
 
Line 68: Line 70:
 
// for Layer Control
 
// for Layer Control
 
var baseMaps = {
 
var baseMaps = {
     "Open Street Map": osm 
+
     "Open Street Map": osm
 +
    "Open Topo Map": topo,
 
};
 
};
  

Revision as of 10:25, 25 February 2022