Created
November 14, 2015 05:42
-
-
Save giraldeau/89fa5b25c32092e2ce62 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log("loading...") | |
var OSRM = require('osrm'); | |
var osrm = new OSRM("geofabrik/canada-latest.osrm"); | |
console.log("begin") | |
var coord = []; | |
coord.push([45.5370569, -73.5708777]); | |
coord.push([46.0243857, -73.439845]); | |
var query = { | |
coordinates: coord, | |
alternateRoute: false, | |
}; | |
osrm.route(query, function(err, result) { | |
if (err) | |
console.log("error: " + err); | |
console.log("ok: " + JSON.stringify(result, null, 4)); | |
}); | |
console.log("done") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment