osrm-text-instructions
Advanced tools
Comparing version 0.0.3 to 0.0.4
@@ -8,2 +8,6 @@ # Change Log | ||
## 0.0.4 2016-10-20 | ||
- Fix Mapbox API inconsistency with ref/name | ||
## 0.0.3 2016-10-19 | ||
@@ -10,0 +14,0 @@ |
11
index.js
@@ -120,4 +120,13 @@ var instructions = require('./instructions.json'); | ||
var wayName; | ||
var name = (step.name || '').replace(' (' + step.ref + ')', ''); // Remove hack from Mapbox Directions mixing ref into name | ||
var name = step.name || ''; | ||
var ref = (step.ref || '').split(';')[0]; | ||
// Remove hacks from Mapbox Directions mixing ref into name | ||
if (name === step.ref) { | ||
// if both are the same we assume that there used to be an empty name, with the ref being filled in for it | ||
// we only need to retain the ref then | ||
name = ''; | ||
} | ||
name = name.replace(' (' + step.ref + ')', ''); | ||
if (name && ref && name !== ref) { | ||
@@ -124,0 +133,0 @@ wayName = name + ' (' + ref + ')'; |
@@ -6,3 +6,3 @@ { | ||
"homepage": "http://project-osrm.org", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"main": "./index.js", | ||
@@ -9,0 +9,0 @@ "license": "BSD-2-Clause", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
120574
306
4613