better feedback of clicks and moves

pull/180/head
Dave Conway-Jones 3 years ago
parent 32f74a25ab
commit fef76473c3
No known key found for this signature in database
GPG Key ID: 88BA2B8A411BE9FF

@ -1,16 +1,17 @@
### Change Log for Node-RED Worldmap
- v2.17.3 - Yet more better feedback on clicks, moves.
- v2.17.2 - Add smallplane icon.
- v2.17.1 - More complete feedback on click, better popup image sizing.
- v2.16.3 - Ensure polygons can be deleted.
- v2.16.2 - better handling of unpacked gpz objects.
- v2.16.2 - Better handling of unpacked kmz objects.
- v2.16.0 - Allow specifying custom base map server.
- v2.15.8 - Adjust ui check timing for UI worldmap.
- v2.15.7 - Tidy up geoJson handling a bit more.
- v2.15.5 - Fix SIDC icons to accept unicoded icons as labels.
- v2.15.4 - Let clear heatmap command do what it says.
- v2.15.3 - Fix panit command to work, try to use alt units, popup alignments.
- v2.15.0 - let speed be text and specify units if required (kt,kn,knots,mph,kmh,kph) default m/s.
- v2.15.0 - Let speed be text and specify units if required (kt,kn,knots,mph,kmh,kph) default m/s.
- v2.14.0 - Let geojson features be clickable if added as overlay.
- v2.13.4 - Fix list of map choices to be in sync. Fix popup auto sizing.
- v2.13.3 - Fix unchanged layer propagation.

@ -11,17 +11,18 @@ map web page for plotting "things" on.
### Updates
- v2.17.3 - Yet more better feedback on clicks, moves.
- v2.17.2 - Add smallplane icon.
- v2.17.1 - More complete feedback on click, better popup image sizing.
- v2.16.3 - Ensure polygons can be deleted.
- v2.16.2 - better handling of unpacked gpz objects.
- v2.16.2 - Better handling of unpacked kmz objects.
- v2.16.0 - Allow specifying custom base map server.
- v2.15.8 - Adjust ui check timing for UI worldmap.
- v2.15.7 - Tidy up geoJson handling a bit more.
- v2.15.5 - Fix SIDC icons to accept unicoded icons as labels.
- v2.15.4 - Let clear heatmap command do what it says.
- v2.15.3 - Fix panit command to work, try to use alt units, popup alignments.
- v2.15.0 - let speed be text and specify units if required (kt,kn,knots,mph,kmh,kph) default m/s.
- v2.15.0 - Let speed be text and specify units if required (kt,kn,knots,mph,kmh,kph) default m/s.
- v2.14.0 - Let geojson features be clickable if added as overlay.
- v2.13.4 - Fix list of map choices to be in sync. Fix popup auto sizing.
- v2.13.3 - Fix unchanged layer propagation.

@ -1,6 +1,6 @@
{
"name": "node-red-contrib-web-worldmap",
"version": "2.17.2",
"version": "2.17.3",
"description": "A Node-RED node to provide a web page of a world map for plotting things on.",
"dependencies": {
"cgi": "0.3.1",

@ -45,6 +45,7 @@ module.exports = function(RED) {
var sockPath = path.posix.join(RED.settings.httpNodeRoot,node.path,'socket');
sockets[node.path] = sockjs.createServer({prefix:sockPath, sockjs_url:libPath, log:function() { return; }});
sockets[node.path].installHandlers(RED.server);
sockets[node.path].on('error', function(e) { node.error("Socket Connection Error: "+e.stack); });
}
//node.log("Serving "+__dirname+" as "+node.path);
node.log("started at "+node.path);

File diff suppressed because one or more lines are too long

@ -76,6 +76,7 @@ if (typeof Object.assign !== 'function') {
// Create the socket
var connect = function() {
// var transports = ["websocket", "xhr-streaming", "xhr-polling"],
ws = new SockJS(location.pathname.split("index")[0] + 'socket');
ws.onopen = function() {
console.log("CONNECTED");
@ -1764,19 +1765,13 @@ function setMarker(data) {
var b = marker.getPopup().getContent().split("heading : ");
if (b.length === 2) { b = parseFloat(b[1].split("<br")[0]); }
else { b = undefined; }
ws.send(JSON.stringify({
action:"move",
name:marker.name,
layer:marker.lay,
lat:parseFloat(marker.getLatLng().lat.toFixed(6)),
lon:parseFloat(marker.getLatLng().lng.toFixed(6)),
hdg:b,
icon:marker.icon,
iconColor:marker.iconColor,
SIDC:marker.SIDC,
draggable:true,
from:oldll
}));
var fb = allData[marker.name];
fb.action = "move";
fb.lat = parseFloat(marker.getLatLng().lat.toFixed(6));
fb.lon = parseFloat(marker.getLatLng().lng.toFixed(6));
fb.from = oldll;
ws.send(JSON.stringify(fb));
});
}
@ -1910,7 +1905,10 @@ function setMarker(data) {
marker.lay = lay; // and the layer it is on
marker.on('click', function(e) {
ws.send(JSON.stringify({action:"click",name:marker.name,layer:marker.lay,icon:marker.icon,iconColor:marker.iconColor,SIDC:marker.SIDC,draggable:true,lat:parseFloat(marker.getLatLng().lat.toFixed(6)),lon:parseFloat(marker.getLatLng().lng.toFixed(6))}));
//ws.send(JSON.stringify({action:"click",name:marker.name,layer:marker.lay,icon:marker.icon,iconColor:marker.iconColor,SIDC:marker.SIDC,draggable:true,lat:parseFloat(marker.getLatLng().lat.toFixed(6)),lon:parseFloat(marker.getLatLng().lng.toFixed(6))}));
var fb = allData[marker.name];
fb.action = "click";
ws.send(JSON.stringify(fb));
});
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); }

Loading…
Cancel
Save