Add route distance and duration

based on PR #215
This commit is contained in:
Dave Conway-Jones 2022-11-23 10:13:51 +00:00
parent 97edd95ddd
commit 937ec40cb6
No known key found for this signature in database
GPG Key ID: 88BA2B8A411BE9FF
3 changed files with 6 additions and 3 deletions

View File

@ -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

View File

@ -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

View File

@ -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);
});
}