mazda-enhanced-compass
mazda-enhanced-compass copied to clipboard
Navigation (online&cached) added
Howdy - Thanks for the pull request. I just skimmed through your additions and it looks pretty good. I will test drive your code (literally).
Couple questions before I merge the request:
- Did you split out my menu maker?
- Maybe I missed it, but I didn't see anything related to input the address.
- You said over in the forums that the route recalculates itself every 5seconds - will that count against the API?
- I may want to reorganize some of your code, so we can better abstract from that. I was playing around with Google's routing API and had a similar implementation. Would be nice to get to a point to support different providers.
Anyway, I will test this weekend :-)
Good job!
Hi
- Yes, I moved menu into two separate js files. One contains menu data and the other contains list of menus. I was annoyed with one long menu, with your items and then items with navigation. So I created two menus and implemented a logic for having multiple independent menus.
- Input address is not implemented yet. One has to hardcode destination GPS coordinates into settings.js file. I do not like it, but it is quite fine for the beginning. I am planning to create some virtual keyboard (or use some existing one), so the user can enter the address. Graphhopper has even geocoding API, so I will use it.
- The route is recalculated only if you are off route. So when you are driving according to the route (+/- 30 metres), then there are no POST request. And yes, every route (re)calculation takes one credit at Graphhopper.
- I wasnt playing with other routing providers, because ffwdme project was using Graphhopper already. One of the great advatnages of this service is, that they provide you list of points. These points represents GPS coorditanes for the route. If you have one long road, then you receive just two points. But if you have curvy road, you receive tens of points. So I can use all these points in OpenLayers LineString to display the route. I do not know, if any other service provides this. However, I do not want to stick to one service provider only. That is why routing logic is based on info parsed from Graphhoper response (see parse method in graph_hopper.js). Actually it is only list of distances, turn types, and points at the route. I parse out instruction text and duration as well, but these are not used. So any service provider, which provides those three info can be used.
The system already has a full keyboard instance that is used for the SMS and Email input. It's a simple object that is globally available. I will work on that part once I merged the pull request.
What's the ffwdme project?
https://github.com/ffwdme/ffwdme.js - navigation in javascript. It has many features, which I did not included into this project.
Hey quaso,
I had finally a chance to test the code tonight however when I load the files up, it won't show up any tiles.
Is there anything else I have to do to get this working?
also used your latest repo, btw.
I attached a .zip of the test.css, test.html, test.js. Put these in the /src/ directory (where jci, jci-patch, system are), and put the routesCacheFile.js in there as well. Then the settings.js file goes in the /src/system/js folder. There is a slight difference in the settings file I attached and the one that is in the latest branch (a comma needed to be added).
I currently use the test.html to input a location, have it generate the route, then go into the browser localStorage and grab the long string of directions/coordinates to put in the routesCacheFile (and then add the destination in the settings.js). But if you have constant internet while driving, all you need to do is put destination in settings file.
At first I did not notice your test env, so I created my own. As it turned out lately, my changes in code are not compatible with your test env, but at least they are working in real car :). In near future I will put some effort into adjusting the code, so it will work in your test env and I can remove mine. Till that time, please use workaround and zip posted by brettalcox.
It was not so hard to fix actually :) There were some relative path issues. Please try now
Ok - I will retry tonight. Thanks guys.
Was this tested in the end?;)
I tested it, but it was a long time ago :)