osrm-text-instructions.js
WIP: This project is under heavy development and should not be integrated yet.
osrm-text-instructions.js is a library to transform OSRM steps into text instructions.
Usage
var osrmTextInstructions = require('osrm-text-instructions')('v5');
// make your request against the API
response.legs.forEach(function(leg) {
leg.steps.forEach(function(step) {
instruction = osrmTextInstructions.compile(step)
});
});
Design goals
- Cross platform Use a translation table in JSON and short logic to allow easy implementations in other languages
- Heavily tests We have a data-driven test suite with fixtures which can be used cross-platform
- Customization Users should be able to easily fork or monkey patch the results to adjust to their own likings
- Translation Allow for translations via Transifex