otisserv: Display driving directions #206
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description ( description of the refactor, including the goals it accomplishes.)
Does not include other changes there were in dev-c3 already to tie param "CustomMapBox" to navD, therefore I could not test outside of on dev-c3 branch
Added Navigation driving directions to the local nav web server.
Saves a lightweight json version of the navd mapbox routing pulling out unnecessary components.
Adds to the json, Current Destination and Current Step.
New tpl for javascript to display information on the screen.
After entering destination through webserver, driving directions will immediately show up.
If refreshed, webpage will display driving directions if param NavDestination is populated, in the case where the user enters the address directly onto the Comma device.
Displays Current Destination, and clearer step text while removing previous steps once completed.
Refreshes every 5 seconds for new data.
Known Limitations:
Does not decrease distance as you drive during that step, I did not want to add additional code to support this to make it lighter.
Without Comma device in the onroad state, entering new destination will not refresh destination or directions since navd does not attempt to pull new mapbox api until device is in the onroad state.
I am not a programmer by trade, this code works for me but can always be optimized.
Verification [](Explain how you tested the refactor for regressions.)
Works fine on my end during my testing period of over a week. Used mobile iOS safari browser as well as chrome loaded onto my infotainment system.