ensure delete drawing appears under drawing events
This commit is contained in:
parent
4f9956d474
commit
b6bbdb64ef
@ -617,6 +617,7 @@ If <i>Web Path</i> is left empty, then by default <code>⌘⇧m</code> - <code>c
|
|||||||
<li><b>delete</b> - when a point or shape is deleted</li>
|
<li><b>delete</b> - when a point or shape is deleted</li>
|
||||||
<li><b>point</b> - when a point is added manually using right-click</li>
|
<li><b>point</b> - when a point is added manually using right-click</li>
|
||||||
<li><b>draw</b> - when a shape is added manually to the drawing layer</li>
|
<li><b>draw</b> - when a shape is added manually to the drawing layer</li>
|
||||||
|
<li><b>drawdelete</b> - when a shape is deleted from the drawing layer</li>
|
||||||
<li><b>layer</b> - when a base layer is changed</li>
|
<li><b>layer</b> - when a base layer is changed</li>
|
||||||
<li><b>addlayer</b> - when an overlay is added to the map</li>
|
<li><b>addlayer</b> - when an overlay is added to the map</li>
|
||||||
<li><b>dellayer</b> - when an overlay is removed from the map</li>
|
<li><b>dellayer</b> - when an overlay is removed from the map</li>
|
||||||
@ -662,10 +663,10 @@ If <i>Web Path</i> is left empty, then by default <code>⌘⇧m</code> - <code>c
|
|||||||
{ value: "connect", label: "Connect"},
|
{ value: "connect", label: "Connect"},
|
||||||
{ value: "disconnect", label: "Disconnect"},
|
{ value: "disconnect", label: "Disconnect"},
|
||||||
{ value: "point", label: "Add, move, delete point"},
|
{ value: "point", label: "Add, move, delete point"},
|
||||||
|
{ value: "draw", label: "Add, edit or delete drawing"},
|
||||||
{ value: "layer", label: "Add, remove layers"},
|
{ value: "layer", label: "Add, remove layers"},
|
||||||
{ value: "bounds", label: "Boundary change"},
|
{ value: "bounds", label: "Boundary change"},
|
||||||
{ value: "files", label: "File drop"},
|
{ value: "files", label: "File drop"},
|
||||||
{ value: "draw", label: "Drawing"},
|
|
||||||
{ value: "other", label: "All other"}
|
{ value: "other", label: "All other"}
|
||||||
]
|
]
|
||||||
}]});
|
}]});
|
||||||
|
@ -139,7 +139,7 @@ module.exports = function(RED) {
|
|||||||
delete message.from;
|
delete message.from;
|
||||||
sendToRest(message,client.id);
|
sendToRest(message,client.id);
|
||||||
}
|
}
|
||||||
if (message.action === "delete") {
|
if (message.action === "delete" || message.action === "drawdelete") {
|
||||||
delete allPoints[message.name];
|
delete allPoints[message.name];
|
||||||
sendToRest(message,client.id);
|
sendToRest(message,client.id);
|
||||||
}
|
}
|
||||||
@ -313,7 +313,7 @@ module.exports = function(RED) {
|
|||||||
message.content = Buffer.from(message.content.split('base64,')[1], 'base64');
|
message.content = Buffer.from(message.content.split('base64,')[1], 'base64');
|
||||||
setImmediate(function() {node.send({payload:message, topic:node.path.substr(1), _sessionid:client.id, _sessionip:sessionip})});
|
setImmediate(function() {node.send({payload:message, topic:node.path.substr(1), _sessionid:client.id, _sessionip:sessionip})});
|
||||||
}
|
}
|
||||||
if ((node.events.indexOf("draw")!==-1) && (message.action === "draw")) {
|
if ((node.events.indexOf("draw")!==-1) && ((message.action === "draw")||(message.action === "drawdelete"))) {
|
||||||
setImmediate(function() {node.send({payload:message, topic:node.path.substr(1), _sessionid:client.id, _sessionip:sessionip})});
|
setImmediate(function() {node.send({payload:message, topic:node.path.substr(1), _sessionid:client.id, _sessionip:sessionip})});
|
||||||
}
|
}
|
||||||
if (node.events.indexOf("other")!==-1 && "connected,point,delete,move,draw,files,bounds".indexOf(message.action) === -1) {
|
if (node.events.indexOf("other")!==-1 && "connected,point,delete,move,draw,files,bounds".indexOf(message.action) === -1) {
|
||||||
|
@ -1384,9 +1384,11 @@ helpText += 'The default is that only visible layers add to the heatmap.</p>';
|
|||||||
// Delete a marker or shape (and notify websocket)
|
// Delete a marker or shape (and notify websocket)
|
||||||
var delMarker = function(dname,note) {
|
var delMarker = function(dname,note) {
|
||||||
if (note) { map.closePopup(); }
|
if (note) { map.closePopup(); }
|
||||||
|
var pol = false;
|
||||||
if (typeof polygons[dname] != "undefined") {
|
if (typeof polygons[dname] != "undefined") {
|
||||||
layers[polygons[dname].lay].removeLayer(polygons[dname]);
|
layers[polygons[dname].lay].removeLayer(polygons[dname]);
|
||||||
delete polygons[dname];
|
delete polygons[dname];
|
||||||
|
pol = true;
|
||||||
}
|
}
|
||||||
if (typeof polygons[dname+"_"] != "undefined") {
|
if (typeof polygons[dname+"_"] != "undefined") {
|
||||||
layers[polygons[dname+"_"].lay].removeLayer(polygons[dname+"_"]);
|
layers[polygons[dname+"_"].lay].removeLayer(polygons[dname+"_"]);
|
||||||
@ -1402,7 +1404,10 @@ var delMarker = function(dname,note) {
|
|||||||
delete markers[dname];
|
delete markers[dname];
|
||||||
}
|
}
|
||||||
delete allData[dname];
|
delete allData[dname];
|
||||||
if (note) { ws.send(JSON.stringify({action:"delete", name:dname, deleted:true})); }
|
if (note) {
|
||||||
|
if (pol === false) { ws.send(JSON.stringify({action:"delete", name:dname, deleted:true})); }
|
||||||
|
else { ws.send(JSON.stringify({action:"drawdelete", name:dname, deleted:true}))}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var editPoly = function(pname,fun) {
|
var editPoly = function(pname,fun) {
|
||||||
|
Loading…
Reference in New Issue
Block a user