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 vertex keys to edges of calculated route #84

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nickw1
Copy link
Contributor

@nickw1 nickw1 commented Feb 5, 2023

This is a small change to index.ts to add the vertex keys to the edgeDatas of each edge of the calculated route.

Why is this useful? It allows an approximate calculation of the distance of each edge on the route. For my use case (an augmented-reality walking app), I wish to calculate what proportion of the route is on footpaths (trails), and reject the route if the proportion is below a certain value. Adding the vertex keys to each edge allows this.

Tested (on my own app, https://github.com/nickw1/hikar.js) and it works, I also displayed each edgeData on the console, and it shows up as expected.

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.

1 participant