maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Nokia N9 / N950 (https://talk.maemo.org/forumdisplay.php?f=51)
-   -   [MOD] Enable Traffic/Automatic day-night in Drive & Traffic in Maps (https://talk.maemo.org/showthread.php?t=85353)

sillieidiot 2012-07-24 02:52

Re: [MOD] How to enable Traffic/Automatic day-night in Drive for PR1.2/1.3
 
Quote:

Originally Posted by mbanck (Post 1241559)
Hrm, did you also apply the "optimized route" patch from http://talk.maemo.org/showpost.php?p...&postcount=189 ?

Would be usefule to know whether the behaviour you saw was possibly because of the patch and route option.

nope. only used the stable patch with the map colors and traffic.

sony123 2012-07-24 04:41

Re: [MOD] How to enable Traffic/Automatic day-night in Drive for PR1.2/1.3
 
Quote:

Originally Posted by mbanck (Post 1241562)
I went through the thread again, and the only possible feedback I saw was the post from sillieidiot I just replied to.

As the optimized-route patch is not included in colin.stephane's UNSTABLE patch, I guess not many tried it yet.

Ok then let's wait for more feedback.

sony123 2012-07-24 04:47

Re: [MOD] How to enable Traffic/Automatic day-night in Drive for PR1.2/1.3
 
Quote:

Originally Posted by sillieidiot (Post 1241968)
nope. only used the stable patch with the map colors and traffic.

I think I experienced this a couple of times, but I don't use Drive app often enough to see a pattern...

efion 2012-07-24 05:17

Re: [MOD] How to enable Traffic/Automatic day-night in Drive for PR1.2/1.3
 
I use the patch methodes, and it says it's all done, but nothing's happen, the map colors button still day and night, and LA traffic doesn't show up.

Updated: Sorry, wrong patches, it's all working by now :)

Kroll 2012-07-26 10:01

Re: [MOD] How to enable Traffic/Automatic day-night in Drive for PR1.2/1.3
 
~ # apt-get install -y --reinstall nokia-drive-
qml && sync && patch -p0 -i Patch-to-enable-tra
ffic-and-day-night-autoswitch-in-drive-for-N9-P
R1.3.diff
Чтение списков пакетов... Готово
Построение дерева зависимостей
Чтение информации о состоянии... Готово
Пакеты, которые будут обновлены:
nokia-drive-qml
обновлено 1, установлено 0 новых пакетов, переустановлено 1 переустановлено, для удаления отмечено 0 пакетов, и 0 пакетов не обновлено.
Необходимо скачать 1,817kБ архивов.
После данной операции, объём занятого дискового пространства возрастёт на 0B.
Получено:1 https://downloads.maemo.nokia.com ./ nokia-drive-qml 2.0.8+0m8 [1,817kB]
Получено 1,817kБ за 1с (1,320kБ/c)
(Чтение базы данных ... на данный момент установлено 50599 файлов и каталогов.)
Подготовка к замене пакета nokia-drive-qml 2.0.8+0m8 (используется файл .../nokia-drive-qml_2.0.8+0m8_armel.deb) ...
Распаковывается замена для пакета nokia-drive-qml ...
aegis-installing nokia-drive-qml (from 'com.nokia.maemo')
Обрабатываются триггеры для desktop-file-utils...
Обрабатываются триггеры для applauncherd-launcher ...
Настраивается пакет nokia-drive-qml (2.0.8+0m8) ...
Updating desktop entries... Done
sh: patch: not found
~ #

nothing happend, there is no Traffic on the map.

kfahoo 2012-07-26 10:15

Re: [MOD] How to enable Traffic/Automatic day-night in Drive for PR1.2/1.3
 
Quote:

Originally Posted by mbanck (Post 1239818)
But if people want to test around, here is a patch: http://paste.debian.net/download/179798

(Setting routeOptionType to 2 instead of 3 clearly selects the shortest route for me)

will it work if I just simply change
Code:

routeType: RouteOptions.TYPE_FASTEST
to
Code:

routeType: RouteOptions.3
?




Quote:

Originally Posted by Kroll (Post 1243154)
~ #
sh: patch: not found
~ #

nothing happend, there is no Traffic on the map.

first install patch from http://harmattan-dev.nokia.com/pool/...+0m6_armel.deb

Kroll 2012-07-26 10:26

Re: [MOD] How to enable Traffic/Automatic day-night in Drive for PR1.2/1.3
 
Quote:

Originally Posted by kfahoo (Post 1243158)

#
~ # dpkg -i patch_2.6-2+maemo7+0m6_armel.deb
Aegis rejecting patch_2.6-2+maemo7+0m6_armel.deb: Could not open debian archive
aegis aborting dpkg -- all listed package files rejected
Compilation failed in require.
~ #

mbanck 2012-07-26 15:09

Re: [MOD] How to enable Traffic/Automatic day-night in Drive for PR1.2/1.3
 
Quote:

Originally Posted by kfahoo (Post 1243158)
will it work if I just simply change
Code:

routeType: RouteOptions.TYPE_FASTEST
to
Code:

routeType: RouteOptions.3
?

I believe I tried that, but I got an error message back and it did not work. If you manage to get it to work (i.e. you get no additional error messages on the console if you start it in debug mode), that would make things easier. Note that I believe TYPE_FASTEST is the default, so if you get an error, it will silently revert to TYPE_FASTEST and appear to be working.

taviman 2012-07-26 19:13

Re: [MOD] How to enable Traffic/Automatic day-night in Drive for PR1.2/1.3
 
Quote:

Originally Posted by Kroll (Post 1243165)
#
~ # dpkg -i patch_2.6-2+maemo7+0m6_armel.deb
Aegis rejecting patch_2.6-2+maemo7+0m6_armel.deb: Could not open debian archive
aegis aborting dpkg -- all listed package files rejected
Compilation failed in require.
~ #

Kroll, move the patch_2.6 to "Downloads" with Filebox.

devel-su
rootme
cd home/user/MyDocs/Downloads
dpkg -i patch_2.6*.deb

this worked for me.

Kroll 2012-07-27 07:04

Re: [MOD] How to enable Traffic/Automatic day-night in Drive for PR1.2/1.3
 
@taviman
Thanks! That worked for me too!

sony123 2012-07-27 07:27

Re: [MOD] How to enable Traffic/Automatic day-night in Drive for PR1.2/1.3
 
I tried the different route option settings today. Shortest and fastest gave me distinctly different routes. But I am not sure about 3, it gave me the same route as fastest, when the traffic on the route was red.

I also experimented with adding this route option to AppSettingsModel and exposed it to setting menu. But unsurprisingly, only pre-defined variables (in settingManager) are allowed so I couldn't use the set method to store the route option. I then added it as a property to AppSettingsModel, but like the comments in the code suggested, property in this QtObject is not reliable and I couldn't change the property either.

sony123 2012-07-27 07:50

Re: [MOD] How to enable Traffic/Automatic day-night in Drive for PR1.2/1.3
 
Today I also took a look at Maps' qml codes under /usr/share/maps/qml, hoping I could find something interesting.

But the only thing I found was a setting to enable automatic 2D/3D transition (e.g. zoom out becomes 2D, zoom in becomes 3D), but the implementation wasn't robust. I didn't see any TODO and traffic-related info. The components implemented in QML are limited, most of the meat are hidden under C++. Maps uses a private MapViewer element for displaying the map, and the codes don't reveal much of what features this object supports.... Overall, the qml codes for Maps is kind of messy compared with Drive's.

The only things I changed so far are exposing the auto 2D/3D feature (not worth it) and get rid of the Analytic element...

anig 2012-07-27 07:55

Re: [MOD] How to enable Traffic/Automatic day-night in Drive for PR1.2/1.3
 
Quote:

Originally Posted by sony123 (Post 1243637)
I tried the different route option settings today. Shortest and fastest gave me distinctly different routes. But I am not sure about 3, it gave me the same route as fastest, when the traffic on the route was red.

I also experimented with adding this route option to AppSettingsModel and exposed it to setting menu. But unsurprisingly, only pre-defined variables (in settingManager) are allowed so I couldn't use the set method to store the route option. I then added it as a property to AppSettingsModel, but like the comments in the code suggested, property in this QtObject is not reliable and I couldn't change the property either.

I don't think the optimised route is based on traffic. It's more likely that it's somewhere in the middle of fastest and shortest as both of those may lead to going along strange routes. In the symbian version there is an additional tick box for "reroute due to traffic".

godofwar424 2012-07-27 21:50

Re: [MOD] How to enable Traffic/Automatic day-night in Drive for PR1.2/1.3
 
Quote:

Originally Posted by anig (Post 1243650)
I don't think the optimised route is based on traffic. It's more likely that it's somewhere in the middle of fastest and shortest as both of those may lead to going along strange routes. In the symbian version there is an additional tick box for "reroute due to traffic".

I wonder if the Symbian Drive app is coded in QML as well??

If so, any chance of getting hold of their QML files and see if we can sneak any features across ;)

mbanck 2012-07-28 15:51

Re: [MOD] How to enable Traffic/Automatic day-night in Drive for PR1.2/1.3
 
Quote:

Originally Posted by sony123 (Post 1243646)
Today I also took a look at Maps' qml codes under /usr/share/maps/qml, hoping I could find something interesting.

One thing Maps has which Drive lacks (in my opinion) is ordering favorites by distance (Drive orders them by modification time, so it is pretty difficult to find the right favorite by swiping through if you have more than a few). I had a look at the Drive QML code a while back trying to change it but did not succeed so far.

There are some references in the Maps QML about favorites, but I could not find a place where the ordering was set or explicitly reordered on a quick look.

mbanck 2012-07-28 15:53

Re: [MOD] How to enable Traffic/Automatic day-night in Drive for PR1.2/1.3
 
Quote:

Originally Posted by mbanck (Post 1244203)
There are some references in the Maps QML about favorites, but I could not find a place where the ordering was set or explicitly reordered on a quick look.

Oh, there is more code under /usr/lib/qt4/imports/ovi/connector/favorites, will have a second look there.

somedude 2012-07-28 18:12

Re: [MOD] How to enable Traffic/Automatic day-night in Drive for PR1.2/1.3
 
I see that the time to distance is blank (- hr) when the distance is over an hour drive, once its below an hour it starts to show 58 min and such.
Using unstable patch.

rainisto 2012-07-28 21:19

Re: [MOD] How to enable Traffic/Automatic day-night in Drive for PR1.2/1.3
 
Quote:

Originally Posted by somedude (Post 1244261)
I see that the time to distance is blank (- hr) when the distance is over an hour drive, once its below an hour it starts to show 58 min and such.
Using unstable patch.

are you sure that your running latest unstable, since it should have been fixed in latest version? See http://talk.maemo.org/showpost.php?p...&postcount=226

sony123 2012-07-29 06:17

Re: [MOD] How to enable Traffic/Automatic day-night in Drive for PR1.2/1.3
 
Quote:

Originally Posted by mbanck (Post 1244205)
Oh, there is more code under /usr/lib/qt4/imports/ovi/connector/favorites, will have a second look there.

Wow there are tons of files under connector/... nice find!

mbanck 2012-07-29 12:57

Re: [MOD] How to enable Traffic/Automatic day-night in Drive for PR1.2/1.3
 
Quote:

Originally Posted by mbanck (Post 1244205)
Oh, there is more code under /usr/lib/qt4/imports/ovi/connector/favorites, will have a second look there.

The code which sorts by distance is there, but I do not have time to try to integrate it into Drive right now. I tried it before and the problem is that the favorites get retrieved without location, then get sorted, and then the distance (and full address) is added. I tried to access the location in the sort method, and also to sort by location afterwards, but it was difficult to access the right javascript objects for that, maybe somebody else has more luck.

Or maybe this isn't such a big issue after all (but it is sure annoying me).

sony123 2012-07-29 15:39

Re: [MOD] How to enable Traffic/Automatic day-night in Drive for PR1.2/1.3
 
Managed to get traffic shown up in Maps. However, traffic doesn't automatically load when panning the map, either the codes don't have it or I haven't found the codes responsible for this yet.

The changes are: make traffic toggle visible in MapSettingsUI.qml, fix un-comment traffic setting loading/storing in MapApi.js, and fix the wrong function argument for trafficObject.requestTrafficAt() in MapApi.js (original code doesn't have 2nd argument for requestTrafficAt(), the argument is radius in km btw). By doing these, traffic show up, just doesn't auto-refresh when panning.

https://dl.dropbox.com/u/54692247/20...9_01-50-50.png

mbanck 2012-07-29 18:29

Re: [MOD] How to enable Traffic/Automatic day-night in Drive for PR1.2/1.3
 
Quote:

Originally Posted by sony123 (Post 1244622)
Managed to get traffic shown up in Maps.

Whoohoo!!!!

sony123 2012-07-31 08:20

Re: [MOD] How to enable Traffic/Automatic day-night in Drive for PR1.2/1.3
 
Quote:

Originally Posted by sony123 (Post 1244622)
Managed to get traffic shown up in Maps. However, traffic doesn't automatically load when panning the map, either the codes don't have it or I haven't found the codes responsible for this yet.

So... traffic actually gets loaded when panning the map, but for whatever reasons, the map view in Maps seems to have a harder time displaying the traffic data. Drive also doesn't always show traffic data when panning, but I feel its behavior is more consistent.

I have tried to understand why and see if there is any workaround, but decided I should give up. It's better to give users options than to perfect a feature that isn't implemented by me.

Again, I don't have a lot of time to clean up what I modified on device. But I hope I can get the diff done this week.......

sony123 2012-07-31 08:22

Re: [MOD] How to enable Traffic/Automatic day-night in Drive for PR1.2/1.3
 
Quote:

Originally Posted by mbanck (Post 1244556)
The code which sorts by distance is there, but I do not have time to try to integrate it into Drive right now. I tried it before and the problem is that the favorites get retrieved without location, then get sorted, and then the distance (and full address) is added. I tried to access the location in the sort method, and also to sort by location afterwards, but it was difficult to access the right javascript objects for that, maybe somebody else has more luck.

Or maybe this isn't such a big issue after all (but it is sure annoying me).

This sounds interesting, I might give it a try after getting the Maps mod cleaned up.

sony123 2012-08-01 07:28

Re: [MOD] Enable Traffic/Automatic day-night in Drive for PR1.2/1.3
 
Here it is the Map traffic patch for testing:
Maps traffic patch unstable

I forgot to backup the original files so pulled the ones from N950 for diff.
As a result, please apply it with caution and at your own risk. Make sure you backup the following folder first!
/usr/lib/qt4/imports/ovi/connector/map


I don't know how to restore Maps in case anything failed. I saw two Maps-related packages, maps and maps-guard, maybe try reinstalling both would help. (<- needs verifying)

To activate traffic, click the setting button on lower right map view (the one you click to select 'public transport', '3d mode', etc.) and toggle 'traffic'. Traffic only gets fetched when map center changes beyond certain threshold, so traffic might not show up immediately. During testing I noticed a few tricks to help traffic shows up:
1. Panning the Maps randomly, for example, drawing circles. Maybe this forces maps redraw....
2. Zooming in/out.
3. Swipe out of Maps then back can help Maps refreshes the map view and hence displays traffic.

For detailed changes, the original code makes traffic request whenever map center shifts beyond 5000 (I believe it means 5km). During testing, I found that requesting traffic frequently doesn't necessarily help displaying traffic, so I referenced Drive's code and add a QML Timer to reduce the number of requests made while panning the map.
I also tweaked the triggering threshold and the request radius... the tweaking is in no way scientific, but I settled on (7km, 30km). FYI, Drive uses (40km, 50km). I did try Drive's setting, but feel it doesn't work as well. Seems to me Maps needs more requesting, but might just be my imagination. Anyway, I encourage people to try other combinations, as well as the interval for the traffic timer.
By the way, if you want to try playing with the parameters, you can un-comment the 'trafficInfo' Text element in MapViewer.qml and the other lines containing trafficInfo. It will display debug messages directly on the top left corner of map view and makes it easier for you to tell when traffic request is sent.

Please post feedback if you can, thanks and enjoy!

sony123 2012-08-01 07:40

Re: [MOD] Enable Traffic/Automatic day-night in Drive & Maps for PR1.2/1.3
 
Just to clarify, the Maps patch is currently not in colin's all-in-one unstable patch, but should be integrate into it once it matures.

anig 2012-08-01 07:42

Re: [MOD] Enable Traffic/Automatic day-night in Drive & Traffic in Maps
 
Just got round to trying the traffic drive. In symbian when you click on an incident, i.e. the triangle icon, it brings up a description of it. Is this possible?

sony123 2012-08-01 07:48

Re: [MOD] Enable Traffic/Automatic day-night in Drive & Traffic in Maps
 
Quote:

Originally Posted by anig (Post 1245820)
Just got round to trying the traffic drive. In symbian when you click on an incident, i.e. the triangle icon, it brings up a description of it. Is this possible?

http://talk.maemo.org/showthread.php?p=1241087#post1241087


In short, possible but not easy.

thedead1440 2012-08-01 08:39

Re: [MOD] Enable Traffic/Automatic day-night in Drive & Traffic in Maps
 
sony123 if you want to re-install maps just do apt-get install maps --reinstall

you don't need to install maps-guard...

Iryus 2012-08-01 09:58

Re: [MOD] Enable Traffic/Automatic day-night in Drive for PR1.2/1.3
 
Quote:

Originally Posted by sony123 (Post 1245813)
Here it is the Map traffic patch for testing:
Maps traffic patch unstable

I forgot to backup the original files so pulled the ones from N950 for diff.
As a result, please apply it with caution and at your own risk. Make sure you backup the following folder first!
/usr/lib/qt4/imports/ovi/connector/map


I don't know how to restore Maps in case anything failed. I saw two Maps-related packages, maps and maps-guard, maybe try reinstalling both would help. (<- needs verifying)

To activate traffic, click the setting button on lower right map view (the one you click to select 'public transport', '3d mode', etc.) and toggle 'traffic'. Traffic only gets fetched when map center changes beyond certain threshold, so traffic might not show up immediately. During testing I noticed a few tricks to help traffic shows up:
1. Panning the Maps randomly, for example, drawing circles. Maybe this forces maps redraw....
2. Zooming in/out.
3. Swipe out of Maps then back can help Maps refreshes the map view and hence displays traffic.

For detailed changes, the original code makes traffic request whenever map center shifts beyond 5000 (I believe it means 5km). During testing, I found that requesting traffic frequently doesn't necessarily help displaying traffic, so I referenced Drive's code and add a QML Timer to reduce the number of requests made while panning the map.
I also tweaked the triggering threshold and the request radius... the tweaking is in no way scientific, but I settled on (7km, 30km). FYI, Drive uses (40km, 50km). I did try Drive's setting, but feel it doesn't work as well. Seems to me Maps needs more requesting, but might just be my imagination. Anyway, I encourage people to try other combinations, as well as the interval for the traffic timer.
By the way, if you want to try playing with the parameters, you can un-comment the 'trafficInfo' Text element in MapViewer.qml and the other lines containing trafficInfo. It will display debug messages directly on the top left corner of map view and makes it easier for you to tell when traffic request is sent.

Please post feedback if you can, thanks and enjoy!

Hello,

How to apply your patch because i tried several methods and it doesn't work. Thank you in advance ;)

biatch0 2012-08-02 03:33

Re: [MOD] Enable Traffic/Automatic day-night in Drive & Traffic in Maps
 
So based on posts in this thread, Drive/Maps doesn't know how to reroute based on traffic condition? /sadpanda

Also, is there any site with a list of countries that have traffic information on Nokia Maps/Drive?

sony123 2012-08-02 03:43

Re: [MOD] Enable Traffic/Automatic day-night in Drive & Traffic in Maps
 
Quote:

Originally Posted by biatch0 (Post 1246301)
So based on posts in this thread, Drive/Maps doesn't know how to reroute based on traffic condition? /sadpanda

No it doesn't.

Quote:

Also, is there any site with a list of countries that have traffic information on Nokia Maps/Drive?
http://maps.nokia.com
:D

sony123 2012-08-02 03:48

Re: [MOD] Enable Traffic/Automatic day-night in Drive for PR1.2/1.3
 
Quote:

Originally Posted by Iryus (Post 1245876)
Hello,

How to apply your patch because i tried several methods and it doesn't work. Thank you in advance ;)

Sorry the earlier patch seemed to be bad,

I have re-uploaded the patch, please download it and put it in /home/user/MyDocs

Launch terminal, become root, then type:
patch -p0 -i /home/user/MyDocs/maps.patch
(That's -p[zero] not p.o.)

biatch0 2012-08-02 06:51

Re: [MOD] Enable Traffic/Automatic day-night in Drive & Traffic in Maps
 
Quote:

Originally Posted by sony123 (Post 1246304)

Problem is Maps/Drive data doesn't appear to be exactly the same source as the Maps site - some countries have traffic data on the site but not in app. (Besides the obvious lack of a nice list :D)

Iryus 2012-08-02 07:42

Re: [MOD] Enable Traffic/Automatic day-night in Drive for PR1.2/1.3
 
Quote:

Originally Posted by sony123 (Post 1246309)
Sorry the earlier patch seemed to be bad,

I have re-uploaded the patch, please download it and put it in /home/user/MyDocs

Launch terminal, become root, then type:
patch -p0 -i /home/user/MyDocs/maps.patch
(That's -p[zero] not p.o.)


I forgot -i , my bad dude -_- Thanks ;)

gde700 2012-08-02 11:03

Re: [MOD] Enable Traffic/Automatic day-night in Drive & Traffic in Maps
 
1 Attachment(s)
The same patch would not work. Did everything by hand. If you need the corrected files - in the attachment.
Unzip the file and throw 4 files with the replacement of /usr/lib/qt4/imports/ovi/connector/map/

kfahoo 2012-08-02 17:44

Re: [MOD] Enable Traffic/Automatic day-night in Drive & Traffic in Maps
 
works for me; shows traffic in drive and in maps as well

sony123 2012-08-02 21:37

Re: [MOD] Enable Traffic/Automatic day-night in Drive & Traffic in Maps
 
Quote:

Originally Posted by biatch0 (Post 1246301)
So based on posts in this thread, Drive/Maps doesn't know how to reroute based on traffic condition? /sadpanda

For Drive, I seem to find the property to enable routing based on traffic. If we are lucky, the property is Router.useTraffic in models/RoutingModel.qml.

I haven't verified it yet so don't get too excited :D

WhitP 2012-08-02 21:45

Re: [MOD] Enable Traffic/Automatic day-night in Drive & Traffic in Maps
 
Here's hoping for the traffic re-routing!
The traffic in maps is very handy - thanks..

WhitP 2012-08-02 23:17

Re: [MOD] Enable Traffic/Automatic day-night in Drive & Traffic in Maps
 
Curious - at least locally the traffic info in Nokia maps and drive doesn't match the Nokia Maps website.
Some stuff on the website doesn't show up at all but the construction on the main highway is shown in different places. I'm not going for a drive just now to find out which is right!


All times are GMT. The time now is 12:09.

vBulletin® Version 3.8.8