Add route distance and duration

based on PR #215
pull/221/head
Dave Conway-Jones 2 years ago
parent 97edd95ddd
commit 937ec40cb6
No known key found for this signature in database
GPG Key ID: 88BA2B8A411BE9FF

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

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

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

Loading…
Cancel
Save