node.js - Google maps directions from A to B considering traffic -
is there way google maps directions b considering traffic @ moment of calling function?
this code below works fine if empty road:
var gm = require("googlemaps"); gm.directions("from", "where go to" , function ( err, data ) { console.log(data.routes[0].legs[0].distance); console.log(data.routes[0].legs[0].duration); }, "false");
i new google maps, please thought spare?
a quick @ documentation gives clear answer:
durationintraffic (optional) specifies whether directionsleg result should include duration takes account current traffic conditions. feature only available maps business customers. time in current traffic returned if traffic information available in requested area.
Comments
Post a Comment