Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add handling for name and ref #32

Merged
merged 1 commit into from
Oct 19, 2016
Merged

Add handling for name and ref #32

merged 1 commit into from
Oct 19, 2016

Conversation

freenerd
Copy link
Member

Fixes #29

This also introduces automatically-generated fixtures for type: turn

@freenerd freenerd force-pushed the name-ref branch 2 times, most recently from 2e4a542 to d995064 Compare October 18, 2016 21:18
"name": "",
"ref": "Ref1;Ref2"
},
"instruction": "Turn left onto Ref1"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bsudekum @1ec5 @willwhite @karenzshea highlighting here that I've changed the behaviour to only include the first ref, instead of all. This is a debatable decision, but I value conciseness highly here, thus one ref should be sufficient. Choosing the best ref should be smarter though, e.g. via #30.

@@ -109,12 +109,24 @@ module.exports = function(_version) {
// NOOP, since no special logic for that type
}

// Decide way_name with special handling for name and ref
var wayName;
var name = (step.name || '').replace(' (' + step.ref + ')', ''); // Remove hack from Mapbox Directions mixing ref into name
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use a regular expression to make sure we only replace this substring at the end of the name.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use ref and name together
2 participants