diff --git a/worldmap/index.html b/worldmap/index.html index 6aa480e..d5530bf 100644 --- a/worldmap/index.html +++ b/worldmap/index.html @@ -712,8 +712,9 @@ var delMarker = function(dname) { // the MAIN add something to map function function setMarker(data) { - console.log(typeof data, data); + //console.log(typeof data, data); var ll; + var lli = null; var stay = popped; var lay = data.layer || "not known"; @@ -774,6 +775,12 @@ function setMarker(data) { else if (data.hasOwnProperty("lat") && data.hasOwnProperty("lon")) { ll = new L.LatLng((data.lat*1), (data.lon*1)); } else if (data.hasOwnProperty("latitude") && data.hasOwnProperty("longitude")) { ll = new L.LatLng((data.latitude*1), (data.longitude*1)); } else { console.log("No location:",data); return; } + // Adding new L.LatLng object (lli) when optional intensity value is defined. Only for use in heatmap layer + if (typeof data.coordinates == "object") { lli = new L.LatLng(data.coordinates[2],data.coordinates[1],data.coordinates[0]); } + else if (data.hasOwnProperty("lat") && data.hasOwnProperty("lon") && data.hasOwnProperty("int")) { lli = new L.LatLng((data.lat*1), (data.lon*1), (data.int*1)); } + else if (data.hasOwnProperty("latitude") && data.hasOwnProperty("longitude") && data.hasOwnProperty("intensity")) { lli = new L.LatLng((data.latitude*1), (data.longitude*1), (data.intensity*1)); } + else { lli = ll } + var words=""+data.name+"
"; // Create the icons... handle ship, earthquake as specials @@ -889,8 +896,9 @@ function setMarker(data) { rightmenuMarker.setLatLng(e.latlng); map.openPopup(rightmenuMarker); }); - - if (heatAll || map.hasLayer(layers[lay])) { heat.addLatLng(ll); } + if ((data.addtoheatmap !== "false") || (!data.hasOwnProperty("addtoheatmap"))){ // Added to give ability to control if points from active layer contribute to heatmap + if (heatAll || map.hasLayer(layers[lay])) { heat.addLatLng(lli); } + } markers[data.name] = marker; layers[lay].addLayer(marker); }