Contargo / osrm-text-instructions

Text instructions from OSRM route responses

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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 data-driven approach that makes implementations in other programming environments easy to write
  • Test suite Have a data-driven test suite with fixtures which can be used cross-platform
  • Translation Allow for translations via Transifex
  • Customization Users should be able to easily fork or monkey patch the results to adjust to their own likings

Development

Generate Fixtures

Fixtures can be programatically created and updated via scripts/generate_fixtures.js.

About

Text instructions from OSRM route responses


Languages

Language:JavaScript 100.0%