From 937ec40cb6c6db28d5141ef00fa9f68877396604 Mon Sep 17 00:00:00 2001 From: Dave Conway-Jones Date: Wed, 23 Nov 2022 10:13:51 +0000 Subject: [PATCH] Add route distance and duration based on PR #215 --- CHANGELOG.md | 2 +- README.md | 2 +- worldmap/worldmap.js | 5 ++++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3da1722..c065dd8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ ### Change Log for Node-RED Worldmap - - v2.31.1 - Fix missing type property for drawings, and pass back feedback value. Issue #213, Issue #212 + - 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.30.3 - Fix for iframe height. Issue #210 diff --git a/README.md b/README.md index 56cb419..6a05334 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ map web page for plotting "things" on. ### Updates -- v2.31.1 - Fix missing type property for drawings, and pass back feedback value. Issue #213, Issue #212 +- 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.30.3 - Fix for iframe height. Issue #210 - v2.30.2 - Fix for bad handling of mapbox id. Issue #208 diff --git a/worldmap/worldmap.js b/worldmap/worldmap.js index b9f7651..162d39f 100644 --- a/worldmap/worldmap.js +++ b/worldmap/worldmap.js @@ -1131,7 +1131,10 @@ var addOverlays = function(overlist) { var r = decode(data.routes[0].geometry).map( x => L.latLng(x[0],x[1]) ); polygons[n]._latlngs = r; shape.m.line = r; - shape.m.type = {label:"routing",distance : data.routes[0].distance,duration : data.routes[0].duration} + // shape.m.type = {label:"routing", distance:data.routes[0].distance, duration:data.routes[0].duration} + shape.m.type = "route"; + shape.m.distance = data.routes[0].distance; + shape.m.duration = data.routes[0].duration; sendDrawing(n); }); }