mazda-enhanced-compass icon indicating copy to clipboard operation
mazda-enhanced-compass copied to clipboard

Navigation (online&cached) added

Open quaso opened this issue 9 years ago • 12 comments

quaso avatar Jan 08 '16 14:01 quaso

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:

  1. Did you split out my menu maker?
  2. Maybe I missed it, but I didn't see anything related to input the address.
  3. You said over in the forums that the route recalculates itself every 5seconds - will that count against the API?
  4. 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!

flyandi avatar Jan 08 '16 17:01 flyandi

Hi

  1. 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.
  2. 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.
  3. 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.
  4. 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.

quaso avatar Jan 08 '16 19:01 quaso

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?

flyandi avatar Jan 08 '16 19:01 flyandi

https://github.com/ffwdme/ffwdme.js - navigation in javascript. It has many features, which I did not included into this project.

quaso avatar Jan 08 '16 20:01 quaso

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?

flyandi avatar Feb 03 '16 08:02 flyandi

also used your latest repo, btw.

flyandi avatar Feb 03 '16 08:02 flyandi

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.

src.zip

brettalcox avatar Feb 03 '16 13:02 brettalcox

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.

quaso avatar Feb 03 '16 14:02 quaso

It was not so hard to fix actually :) There were some relative path issues. Please try now

quaso avatar Feb 03 '16 15:02 quaso

Ok - I will retry tonight. Thanks guys.

flyandi avatar Feb 03 '16 15:02 flyandi

Was this tested in the end?;)

kkaczmarczyk avatar Aug 31 '16 21:08 kkaczmarczyk

I tested it, but it was a long time ago :)

quaso avatar Sep 01 '16 17:09 quaso