delete markers from heatmap when removed.
to close #218 bump for release
This commit is contained in:
parent
4e18987139
commit
1bdc44f4f9
@ -1,6 +1,9 @@
|
|||||||
### Change Log for Node-RED Worldmap
|
### Change Log for Node-RED Worldmap
|
||||||
|
|
||||||
- v2.33.3 - Undo previous fix as while more technically correct - doesn't look so good. Issue #217
|
- v2.32.0 - Change || to nullish operator ?? to fix numerous dodgy assignments. Issue #219
|
||||||
|
Delete marker now also removes from heatmap layer. Issue #218
|
||||||
|
|
||||||
|
- v2.31.3 - Undo previous fix as while more technically correct - doesn't look so good. Issue #217
|
||||||
- v2.31.2 = Fix more antimeridian crossing wrinkles. Issue #216
|
- v2.31.2 = Fix more antimeridian crossing wrinkles. Issue #216
|
||||||
- v2.31.1 - Fix missing type property for drawings, and pass back feedback value. Add route distance. Issue #213, Issue #212, PR #215
|
- v2.31.1 - Fix missing type property for drawings, and pass back feedback value. Add route distance. Issue #213, Issue #212, PR #215
|
||||||
- v2.31.0 - Better handling of KML files. Issue #211
|
- v2.31.0 - Better handling of KML files. Issue #211
|
||||||
|
@ -11,7 +11,9 @@ map web page for plotting "things" on.
|
|||||||
|
|
||||||
### Updates
|
### Updates
|
||||||
|
|
||||||
- v2.33.3 - Undo previous fix as while more technically correct - doesn't look so good. Issue #217
|
- v2.32.0 - Change || to nullish operator ?? to fix numerous dodgy assignments. Issue #219
|
||||||
|
Delete marker now also removes from heatmap layer. Issue #218
|
||||||
|
- v2.31.3 - Undo previous fix as while more technically correct - doesn't look so good. Issue #217
|
||||||
- v2.31.2 = Fix more antimeridian crossing wrinkles. Issue #216
|
- v2.31.2 = Fix more antimeridian crossing wrinkles. Issue #216
|
||||||
- v2.31.1 - Fix missing type property for drawings, and pass back feedback value. Add route distance. Issue #213, Issue #212, PR #215
|
- v2.31.1 - Fix missing type property for drawings, and pass back feedback value. Add route distance. Issue #213, Issue #212, PR #215
|
||||||
- v2.31.0 - Better handling of KML files. Issue #211
|
- v2.31.0 - Better handling of KML files. Issue #211
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "node-red-contrib-web-worldmap",
|
"name": "node-red-contrib-web-worldmap",
|
||||||
"version": "2.31.3",
|
"version": "2.32.0",
|
||||||
"description": "A Node-RED node to provide a web page of a world map for plotting things on.",
|
"description": "A Node-RED node to provide a web page of a world map for plotting things on.",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@turf/bezier-spline": "~6.5.0",
|
"@turf/bezier-spline": "~6.5.0",
|
||||||
|
@ -1214,9 +1214,13 @@ var addOverlays = function(overlist) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add the heatmap layer
|
// Add the heatmap layer (and add delete LatLng function)
|
||||||
if (overlist.indexOf("HM")!==-1) {
|
if (overlist.indexOf("HM")!==-1) {
|
||||||
heat = L.heatLayer([], {radius:60, gradient:{0.2:'blue', 0.4:'lime', 0.6:'red', 0.8:'yellow', 1:'white'}});
|
heat = L.heatLayer([], {radius:60, gradient:{0.2:'blue', 0.4:'lime', 0.6:'red', 0.8:'yellow', 1:'white'}});
|
||||||
|
heat.delLatLng = function(ll) {
|
||||||
|
heat._latlngs = heat._latlngs.filter(v => { return v != ll; } );
|
||||||
|
heat._redraw();
|
||||||
|
}
|
||||||
layers["_heat"] = new L.LayerGroup().addLayer(heat);
|
layers["_heat"] = new L.LayerGroup().addLayer(heat);
|
||||||
overlays["heatmap"] = layers["_heat"];
|
overlays["heatmap"] = layers["_heat"];
|
||||||
}
|
}
|
||||||
@ -1276,6 +1280,9 @@ var delMarker = function(dname,note) {
|
|||||||
delete polygons[dname+"_"];
|
delete polygons[dname+"_"];
|
||||||
}
|
}
|
||||||
if (typeof markers[dname] != "undefined") {
|
if (typeof markers[dname] != "undefined") {
|
||||||
|
if (heat && markers[dname].hasOwnProperty("_latlng")) {
|
||||||
|
heat.delLatLng(markers[dname]._latlng);
|
||||||
|
}
|
||||||
layers[markers[dname].lay].removeLayer(markers[dname]);
|
layers[markers[dname].lay].removeLayer(markers[dname]);
|
||||||
map.removeLayer(markers[dname]);
|
map.removeLayer(markers[dname]);
|
||||||
delete markers[dname];
|
delete markers[dname];
|
||||||
@ -1333,7 +1340,6 @@ var rangerings = function(latlng, options) {
|
|||||||
|
|
||||||
// the MAIN add something to map function
|
// the MAIN add something to map function
|
||||||
function setMarker(data) {
|
function setMarker(data) {
|
||||||
|
|
||||||
var rightmenu = function(m) {
|
var rightmenu = function(m) {
|
||||||
// customise right click context menu
|
// customise right click context menu
|
||||||
var rightcontext = "";
|
var rightcontext = "";
|
||||||
|
Loading…
Reference in New Issue
Block a user