Merge lp:~joergberroth/unav/poi_quick_access_feature into lp:unav

Proposed by JkB
Status: Superseded
Proposed branch: lp:~joergberroth/unav/poi_quick_access_feature
Merge into: lp:unav
Diff against target: 1238 lines (+832/-125)
14 files modified
nav/class/UI.js (+2/-29)
nav/css/unav.css (+1/-8)
nav/img/header/poiConfig.svg (+207/-0)
nav/img/mode/bike.svg (+18/-13)
nav/img/mode/car.svg (+10/-8)
nav/img/mode/walk.svg (+12/-10)
nav/index.html (+4/-7)
qml/Main.qml (+75/-41)
qml/PoiDetailsPage.qml (+1/-1)
qml/PoiListPage.qml (+1/-1)
qml/PoiQuickAccessPage.qml (+185/-0)
qml/components/NotificationBar.qml (+88/-0)
qml/components/POIQuickAccessGridView.qml (+184/-0)
qml/js/db.js (+44/-7)
To merge this branch: bzr merge lp:~joergberroth/unav/poi_quick_access_feature
Reviewer Review Type Date Requested Status
costales Approve
Nekhelesh Ramananthan Pending
Review via email: mp+294160@code.launchpad.net

This proposal supersedes a proposal from 2016-04-30.

This proposal has been superseded by a proposal from 2016-05-22.

Description of the change

*Implementation of a POI quick access feature

To post a comment you must log in.
Revision history for this message
Nekhelesh Ramananthan (nik90) wrote : Posted in a previous version of this proposal

We didn't discuss about which center point is used for calculating the POIs. In my opinion, this should be similar to the speed camera feature where we show all speed camera along the route. Similarly POIs should be shown along the route with maybe <2Km deviation. That would be really handy.

At the moment, the POIs are shown at the current user position which is okay I guess. But what if I want to see the POIs before starting on a journey?

review: Needs Information
Revision history for this message
costales (costales) wrote : Posted in a previous version of this proposal

Hi! :)

A few thoughts:
- IMO, quick POIs should be Nearby at destination, same as the Nearby side icon :) We talked about that in the current UI approach :) If not, it's inconsistent.
- Icon to set POIs should be in the same gray of others. Maybe a POI + small settings icon?
- After a click, if nothing is found nothing is happen. Because of this I was thinking is not working (try with airports).
- The popup should be hidden after a click in a fast POI.

Thanks for the work Joerg!

Revision history for this message
costales (costales) : Posted in a previous version of this proposal
review: Needs Fixing
Revision history for this message
Nekhelesh Ramananthan (nik90) wrote : Posted in a previous version of this proposal

> - IMO, quick POIs should be Nearby at destination, same as the Nearby side
> icon :) We talked about that in the current UI approach :) If not, it's
> inconsistent.

I disagree. Imagine a use case where the user is starting a road-trip from Netherlands->Belgium, where he uses uNav. We already have Nearby Destination which will allow him to find restaurants, hotels etc at the destination (Belgium. This is very handy as we agreed before.

However, I am pretty sure the idea behind quick POIs is different from NearBy Destination as in it allows the user to find amenities like restaurants, gas-stations, car-repair stations etc during the road-ctrip. Imagine a situation where you are low on fuel / car radiator heating up or something..in that case, it would better if the quick POIs provides quick access to gas stations or car-repair stations within 5 Kms of his current position. Showing them at the destination is of no use if they are 200 Kms away (in Belgium) ;)

And speaking about consistency, the quick POIs are located in the "Route" menu. So it makes sense to show POIs along the route and not at the destination.

Revision history for this message
costales (costales) wrote : Posted in a previous version of this proposal

> However, I am pretty sure the idea behind quick POIs is different from
> NearBy Destination as in it allows the user to find amenities like
> restaurants, gas-stations, car-repair stations etc during the road-ctrip.
> Imagine a situation where you are low on fuel / car radiator heating up or
> something..in that case, it would better if the quick POIs provides quick
> access to gas stations or car-repair stations within 5 Kms of his current
> position. Showing them at the destination is of no use if they are 200 Kms
> away (in Belgium) ;)
>
So it makes sense to show POIs along the route and not at the destination.
>

But this approach then it's no intuitive/easy. Even I didn't know if this
was searching in current pos or destination.

(?) We should duplicate the "Nearby at destination" to "Nearby on route"
and then same dialog for only search on route (I'm not sure if this is
possible with the API because is other [1]). But then, these icons alone
don't take so much sense to me :O

[1] http://wiki.openstreetmap.org/wiki/Nominatim

Revision history for this message
Nekhelesh Ramananthan (nik90) wrote : Posted in a previous version of this proposal

> > However, I am pretty sure the idea behind quick POIs is different from
> > NearBy Destination as in it allows the user to find amenities like
> > restaurants, gas-stations, car-repair stations etc during the road-ctrip.
> > Imagine a situation where you are low on fuel / car radiator heating up or
> > something..in that case, it would better if the quick POIs provides quick
> > access to gas stations or car-repair stations within 5 Kms of his current
> > position. Showing them at the destination is of no use if they are 200 Kms
> > away (in Belgium) ;)
> >
> So it makes sense to show POIs along the route and not at the destination.
> >
>
> But this approach then it's no intuitive/easy. Even I didn't know if this
> was searching in current pos or destination.
>

Then we make it intuitive. Infact it is counter intuitive to expect a POI icon in the "route" menu to only show it in the destination. The destination is a special position. That's it. we are in the route menu. So we show POIs along the route.

We brainstorm on the icon we need to design and use for this feature. Nothing is easy ;) .. we need to work hard to make this feature a possibility.

> (?) We should duplicate the "Nearby at destination" to "Nearby on route"
> and then same dialog for only search on route (I'm not sure if this is
> possible with the API because is other [1]). But then, these icons alone
> don't take so much sense to me :O
>
> [1] http://wiki.openstreetmap.org/wiki/Nominatim

When the speed camera feature was implemented, the API only returns the speed camera in the map. It was Joerg's algorithm that showed the speed camera along the route. We use that same logic for the POIs as well.

Naturally the online API (nominatim) doesn't cover everything. But it is possible with the use of clever javascript code to adjust it to show POIs along the route. I am sure Joerg can do that :).

As for the icons, we will brainstorm.

let's not take the easy way out and say, well icons are unclear..so lets just show the POIs at the destination. Because showing the POIs at the destination is useless. What good is showing a gas station at the destination which might 200 Kms away from the current user position? Explain that to me.

Revision history for this message
costales (costales) wrote : Posted in a previous version of this proposal

Are all we agree about POIs on route as new feature?

I would vote as the same Nearby without distances. 1 main icon in Route
popup for that. But I don't see 3 icons and then set them for ever :) What
do you think?

Revision history for this message
Nekhelesh Ramananthan (nik90) wrote : Posted in a previous version of this proposal

> Are all we agree about POIs on route as new feature?
>
> I would vote as the same Nearby without distances. 1 main icon in Route
> popup for that. But I don't see 3 icons and then set them for ever :) What
> do you think?

Personally I think the quick POIs is a really good idea because it provides fast access to critical amenities like gas-stations, restaurants etc (based on user preferences). We should try to avoid burying it within further menus.

If you look at NearBy Destination POIs, it requires the user to do the following steps,

Step 1: Press on Route header action
Step 2: Press Nearby Destination
Step 3: Search for POI type
Step 4: Click on POI Type
Step 5: Press POI list to see all POIs near the destination.

5 steps is actually a lot. But fine..that's okay.

However, when we talk about Quick POIs, we shouldn't make it this difficult. After all, quick POIs provide access to critical amenities like Gas-stations, car-repair stations, and should be available in as minimum amounts of steps as possible.

I recommend that we stick to the current proposal by Joerg, and just fine tune the design instead of changing it completely. With his design, a user searching for gas-stations have to do the following,

Step 1: Press on route header action
Step 2: Press gas-station icon

And voila! He can see all near by gas-stations. Let's keep it that simple!

Revision history for this message
Nekhelesh Ramananthan (nik90) wrote : Posted in a previous version of this proposal

And these 3 POIs are not something you set forever. You can easily adjust it to match your usecase.

Revision history for this message
costales (costales) wrote : Posted in a previous version of this proposal

OK We keep the current approach :)

Then, what should search those icons? current position, current destination
or POIs on route?

And how the user know what are those action for?

A hug!

--
Sent using Dekko from my Ubuntu device

Revision history for this message
JkB (joergberroth) wrote : Posted in a previous version of this proposal

Hi,

great that you worked it out.

IMO, the current approach to quick access pois at current user position
is the way to go.

First, I thought of searching along the route, too. But, I think that
searching at the current location is a more general approach as it shows
you all possible places to go around and not just those which stick to
the route.

Best Joerg

Am 02.05.2016 um 10:06 schrieb costales:
> OK We keep the current approach :)
>
> Then, what should search those icons? current position, current destination
> or POIs on route?
>
> And how the user know what are those action for?
>
> A hug!
>

Revision history for this message
costales (costales) wrote : Posted in a previous version of this proposal

I added a few minor improvements.

The branch needs:
- Merge me here.
- Branch trunk here.
- You can choose 5 fast POIs, I only see 3 fast POIs.

A hug :)

review: Needs Fixing
Revision history for this message
Nekhelesh Ramananthan (nik90) wrote : Posted in a previous version of this proposal

One more question, do we need really need a distance range filter to be shown? If you are going from Point A -> Point B, you wouldn't deviate 15 Kms just to get to a gas-station ;) .. May be we can default to 5 Kms distance filter.

Another benefit is that we can then use the page header sections for the transport type (car, bicyle, walk)

Revision history for this message
JkB (joergberroth) wrote : Posted in a previous version of this proposal

Well, I was thinking of that, but also I disagree on that, because there
are different ranges for single pois you might want to take into
consideration.
E.g. Gas stations. I do not run outof gas within 5km so I would set the
range higher to get more possible places to go.
On the other hand, going by bike I would generally take shorter distances
into consideration and for walking even shorter.
So int the end it might really rely on what you are searching specifically.
Should we really take that decision for the user?

Am Dienstag, 3. Mai 2016 23:25:05 CEST schrieb Nekhelesh Ramananthan
<email address hidden>:
> One more question, do we need really need a distance range
> filter to be shown? If you are going from Point A -> Point B,
> you wouldn't deviate 15 Kms just to get to a gas-station ;) ..
> May be we can default to 5 Kms distance filter.
>
> Another benefit is that we can then use the page header
> sections for the transport type (car, bicyle, walk)

--
Versandt, mit Dekko von meinem Ubuntu-Gerät

Revision history for this message
Nekhelesh Ramananthan (nik90) wrote : Posted in a previous version of this proposal

>
> Well, I was thinking of that, but also I disagree on that, because there
> are different ranges for single pois you might want to take into
> consideration.
> E.g. Gas stations. I do not run outof gas within 5km so I would set the
> range higher to get more possible places to go.
> On the other hand, going by bike I would generally take shorter distances
> into consideration and for walking even shorter.
> So int the end it might really rely on what you are searching specifically.
> Should we really take that decision for the user?

You're right about the different filter ranges for different POI types.

But the question to really ask is, if you would really deviate 10 KMs or more from your route to go to that Gas station? Which is why I initially requested that we show POI along the route, since that's more helpful for the user.

But I can see the reasoning for showing POIs around the current position of the user. But I think it is a bit far fetched for a user to deviate 10 Kms from his route to get to a POI. At least that is my opinion.

Revision history for this message
JkB (joergberroth) wrote : Posted in a previous version of this proposal

Well, let's keep it up to the user, I would say.

Am Mittwoch, 4. Mai 2016 00:23:05 CEST schrieb Nekhelesh Ramananthan
<email address hidden>:
>>
>> Well, I was thinking of that, but also I disagree on that, because there
>> are different ranges for single pois you might want to take into
>> consideration.
>> E.g. Gas stations. I do not run outof gas within 5km so I would set the
>> range higher to get more possible places to go.
>> On the other hand, going by bike I would generally take shorter distances
>> into consideration and for walking even shorter.
>> So int the end it might really rely on what you are searching
>> specifically.
>> Should we really take that decision for the user?
>
> You're right about the different filter ranges for different POI types.
>
> But the question to really ask is, if you would really deviate
> 10 KMs or more from your route to go to that Gas station? Which
> is why I initially requested that we show POI along the route,
> since that's more helpful for the user.
>
> But I can see the reasoning for showing POIs around the current
> position of the user. But I think it is a bit far fetched for a
> user to deviate 10 Kms from his route to get to a POI. At least
> that is my opinion.

--
Versandt, mit Dekko von meinem Ubuntu-Gerät

Revision history for this message
costales (costales) wrote : Posted in a previous version of this proposal

Click on a POI which doesn't return any POI near is not intuitive.
Example, search fast airports at 1km and you'll not see anything, but you'll not get anything.

review: Needs Fixing
Revision history for this message
costales (costales) wrote : Posted in a previous version of this proposal

@Joerg: Do you think would be possible show POIs near to route? (500m?) in the blue line if there is a route? As your radars query?
I think that would be a really useful fast POIs, more than the arround.

If there isn't a route, then as now.

Revision history for this message
JkB (joergberroth) wrote : Posted in a previous version of this proposal

Read my posts below.
I would not do it in general.
But we could add an seperate option to each choice that allows for that.

Am Donnerstag, 5. Mai 2016 19:06:11 CEST schrieb costales
<email address hidden>:
> @Joerg: Do you think would be possible show POIs near to route?
> (500m?) in the blue line if there is a route? As your radars
> query?
> I think that would be a really useful fast POIs, more than the arround.
>
> If there isn't a route, then as now.

--
Versandt, mit Dekko von meinem Ubuntu-Gerät

Revision history for this message
JkB (joergberroth) wrote : Posted in a previous version of this proposal

That's right. Iwill add a hint.

Am Donnerstag, 5. Mai 2016 19:04:20 CEST schrieb costales
<email address hidden>:
> Review: Needs Fixing
>
> Click on a POI which doesn't return any POI near is not intuitive.
> Example, search fast airports at 1km and you'll not see
> anything, but you'll not get anything.

--
Versandt, mit Dekko von meinem Ubuntu-Gerät

Revision history for this message
Nekhelesh Ramananthan (nik90) wrote : Posted in a previous version of this proposal

There are code conficts in your branch.

review: Needs Fixing
74. By JkB

*merge costales branch

75. By JkB

* made the notifications more generic.
*wip

Revision history for this message
costales (costales) wrote :

Click 1 time in a fast nearby POI without results > Show no results = OK.
Click again in that POI, you'll see "Searching..." but never the error.

review: Needs Fixing
76. By JkB

* minor fixes
* integrate speed camera errors

77. By JkB

*update unav.css

78. By JkB

*fix small issue with searching descirbed by costales

79. By JkB

*merge costales fixes as wip

80. By JkB

*separation of "info" and "warning/critical" appearance in NotificationBar.qml

81. By JkB

*additional notification improvements

Revision history for this message
costales (costales) wrote :

Great work Joerg!

review: Approve
82. By JkB

*minor design fixes
*only show current mode in PoiQuickAccessPage.qml

83. By JkB

* add search radius hint

84. By JkB

*minor design change

85. By JkB

*costales fixes
*improve search radius design

86. By JkB

*minor fixes

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'nav/class/UI.js'
--- nav/class/UI.js 2016-04-22 18:37:23 +0000
+++ nav/class/UI.js 2016-05-22 10:44:41 +0000
@@ -483,33 +483,7 @@
483}483}
484484
485UI.prototype.KO_API_radars = function() {485UI.prototype.KO_API_radars = function() {
486 $('#error_get_radars').show();486 qml_show_notification('warning', 'speed_camera_error')
487 this.error_API_radars();
488 $('#error_get_radars').delay(8000).fadeOut('slow');
489}
490
491UI.prototype.error_API_radars = function() {
492 if (!$('#panel_msg').is(":visible") && !$('#panel_summary').is(":visible") && !$('#panel_review_btns').is(":visible")) {
493 $('#error_get_radars').hide();
494 return;
495 }
496
497 if ($('#error_get_radars').is(":visible")) {
498 var aux_height = 0;
499 if ($('#panel_review_btns').is(':visible'))
500 aux_height = aux_height + $('#panel_review_btns').height();
501 if ($('#panel_review_summary').is(':visible'))
502 aux_height = aux_height + $('#panel_review_summary').height();
503 if ($('#panel_summary').is(':visible'))
504 aux_height = aux_height + $('#panel_summary').height();
505 if ($('#panel_txt_ind').is(':visible'))
506 aux_height = aux_height + $('#panel_txt_ind').height();
507 if ($('#panel_msg').is(':visible'))
508 aux_height = aux_height + $('#panel_msg').height();
509
510 $('#error_get_radars').css({bottom: aux_height});
511 $('.ol-scale-line').css({top: (window.innerHeight - aux_height - 22), bottom: 'auto'});
512 }
513}487}
514488
515UI.prototype.map_height = function() {489UI.prototype.map_height = function() {
@@ -634,8 +608,7 @@
634 this.markers(gps_data['start_lat'], gps_data['start_lng'], gps_data['end_lat'], gps_data['end_lng']);608 this.markers(gps_data['start_lat'], gps_data['start_lng'], gps_data['end_lat'], gps_data['end_lng']);
635 609
636 this.panels(route_indicator);610 this.panels(route_indicator);
637 this.error_API_radars();611
638
639 this.scale_line();612 this.scale_line();
640 613
641 this.pos(gps_data['now_lat'], gps_data['now_lng'], gps_data['accu']);614 this.pos(gps_data['now_lat'], gps_data['now_lng'], gps_data['accu']);
642615
=== modified file 'nav/css/unav.css'
--- nav/css/unav.css 2016-04-24 16:11:11 +0000
+++ nav/css/unav.css 2016-05-22 10:44:41 +0000
@@ -30,7 +30,7 @@
30#panel_review_btns {30#panel_review_btns {
31 bottom:25px;31 bottom:25px;
32}32}
33#panel_summary, #panel_review_summary, #error_get_radars {33#panel_summary, #panel_review_summary {
34 position:absolute;34 position:absolute;
35 bottom:0px;35 bottom:0px;
36 width:100%;36 width:100%;
@@ -148,10 +148,3 @@
148 font-family:Ubuntu, Arial, Helvetica, sans-serif;font-size:16px;border-style:solid;148 font-family:Ubuntu, Arial, Helvetica, sans-serif;font-size:16px;border-style:solid;
149 text-align:center;149 text-align:center;
150}150}
151
152#error_get_radars {
153 color: #ffffff;
154 height:20px;
155 background: #ed3146;
156 z-index: 3;
157}
158151
=== added file 'nav/img/header/poiConfig.svg'
--- nav/img/header/poiConfig.svg 1970-01-01 00:00:00 +0000
+++ nav/img/header/poiConfig.svg 2016-05-22 10:44:41 +0000
@@ -0,0 +1,207 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!-- Created with Inkscape (http://www.inkscape.org/) -->
3
4<svg
5 xmlns:dc="http://purl.org/dc/elements/1.1/"
6 xmlns:cc="http://creativecommons.org/ns#"
7 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
8 xmlns:svg="http://www.w3.org/2000/svg"
9 xmlns="http://www.w3.org/2000/svg"
10 xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
11 xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
12 width="96"
13 height="96"
14 id="svg4874"
15 version="1.1"
16 inkscape:version="0.91 r13725"
17 viewBox="0 0 96 96.000001"
18 sodipodi:docname="poiConfig.svg">
19 <defs
20 id="defs4876" />
21 <sodipodi:namedview
22 id="base"
23 pagecolor="#ffffff"
24 bordercolor="#666666"
25 borderopacity="1.0"
26 inkscape:pageopacity="0.0"
27 inkscape:pageshadow="2"
28 inkscape:zoom="5.7646076"
29 inkscape:cx="82.687528"
30 inkscape:cy="35.845324"
31 inkscape:document-units="px"
32 inkscape:current-layer="g4780"
33 showgrid="false"
34 showborder="true"
35 fit-margin-top="0"
36 fit-margin-left="0"
37 fit-margin-right="0"
38 fit-margin-bottom="0"
39 inkscape:snap-bbox="true"
40 inkscape:bbox-paths="true"
41 inkscape:bbox-nodes="true"
42 inkscape:snap-bbox-edge-midpoints="true"
43 inkscape:snap-bbox-midpoints="true"
44 inkscape:object-paths="true"
45 inkscape:snap-intersection-paths="true"
46 inkscape:object-nodes="true"
47 inkscape:snap-smooth-nodes="true"
48 inkscape:snap-midpoints="true"
49 inkscape:snap-object-midpoints="true"
50 inkscape:snap-center="true"
51 showguides="false"
52 inkscape:guide-bbox="true"
53 inkscape:window-width="1680"
54 inkscape:window-height="974"
55 inkscape:window-x="0"
56 inkscape:window-y="24"
57 inkscape:window-maximized="1">
58 <inkscape:grid
59 type="xygrid"
60 id="grid5451"
61 empspacing="8" />
62 <sodipodi:guide
63 orientation="1,0"
64 position="8,-8.0000001"
65 id="guide4063" />
66 <sodipodi:guide
67 orientation="1,0"
68 position="4,-8.0000001"
69 id="guide4065" />
70 <sodipodi:guide
71 orientation="0,1"
72 position="-8,88.000001"
73 id="guide4067" />
74 <sodipodi:guide
75 orientation="0,1"
76 position="-8,92.000001"
77 id="guide4069" />
78 <sodipodi:guide
79 orientation="0,1"
80 position="104,4"
81 id="guide4071" />
82 <sodipodi:guide
83 orientation="0,1"
84 position="-5,8.0000001"
85 id="guide4073" />
86 <sodipodi:guide
87 orientation="1,0"
88 position="92,-8.0000001"
89 id="guide4075" />
90 <sodipodi:guide
91 orientation="1,0"
92 position="88,-8.0000001"
93 id="guide4077" />
94 <sodipodi:guide
95 orientation="0,1"
96 position="-8,84.000001"
97 id="guide4074" />
98 <sodipodi:guide
99 orientation="1,0"
100 position="12,-8.0000001"
101 id="guide4076" />
102 <sodipodi:guide
103 orientation="0,1"
104 position="-5,12"
105 id="guide4078" />
106 <sodipodi:guide
107 orientation="1,0"
108 position="84,-9.0000001"
109 id="guide4080" />
110 <sodipodi:guide
111 position="48,-8.0000001"
112 orientation="1,0"
113 id="guide4170" />
114 <sodipodi:guide
115 position="-8,48"
116 orientation="0,1"
117 id="guide4172" />
118 </sodipodi:namedview>
119 <metadata
120 id="metadata4879">
121 <rdf:RDF>
122 <cc:Work
123 rdf:about="">
124 <dc:format>image/svg+xml</dc:format>
125 <dc:type
126 rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
127 <dc:title />
128 </cc:Work>
129 </rdf:RDF>
130 </metadata>
131 <g
132 inkscape:label="Layer 1"
133 inkscape:groupmode="layer"
134 id="layer1"
135 transform="translate(67.857146,-78.50504)">
136 <g
137 transform="matrix(0,-1,-1,0,373.50506,516.50504)"
138 id="g4845"
139 style="display:inline">
140 <g
141 inkscape:export-ydpi="90"
142 inkscape:export-xdpi="90"
143 inkscape:export-filename="next01.png"
144 transform="matrix(-0.9996045,0,0,1,575.94296,-611.00001)"
145 id="g4778"
146 inkscape:label="Layer 1">
147 <g
148 transform="matrix(-1,0,0,1,575.99999,611)"
149 id="g4780"
150 style="display:inline">
151 <path
152 style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:1;fill:#191919;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2.99940658;marker:none;enable-background:accumulate"
153 d="m 434.00087,406.61221 a 22.758997,22.749993 0 0 1 -22.75899,22.75001 22.758997,22.749993 0 0 1 -7.93626,-1.44409 22.759,22.749993 0 0 0 1.09249,0.38453 c -12.50395,-4.16624 -36.30903,-12.54166 -54.43048,-21.68874 8.8e-4,-8.4e-4 0.003,-8.4e-4 0.003,-0.002 l -0.003,-0.002 c 18.12145,-9.14708 41.92653,-17.5225 54.43048,-21.68873 a 22.758997,22.749993 0 0 1 6.84377,-1.05956 22.758997,22.749993 0 0 1 22.75899,22.74997 z m -3.50138,0 a 19.257622,19.250002 0 0 0 -19.25761,-19.24998 19.257622,19.250002 0 0 0 -19.25765,19.24998 19.257622,19.250002 0 0 0 19.25765,19.25002 19.257622,19.250002 0 0 0 19.25761,-19.25002 z"
154 id="path4176"
155 inkscape:connector-curvature="0" />
156 <rect
157 style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:none;stroke:none;stroke-width:4;marker:none;enable-background:accumulate"
158 id="rect4782"
159 width="96.037987"
160 height="96"
161 x="-438.00244"
162 y="345.36221"
163 transform="scale(-1,1)" />
164 <rect
165 style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:none;stroke:none;stroke-width:4;marker:none;enable-background:accumulate"
166 id="rect4782-9"
167 width="47.169224"
168 height="47.150566"
169 x="-393.25696"
170 y="354.67883"
171 transform="scale(-1,1)" />
172 <path
173 inkscape:connector-curvature="0"
174 style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:15px;line-height:125%;font-family:Ubuntu;-inkscape-font-specification:Ubuntu;text-align:center;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;display:inline;fill:#808080;fill-opacity:1;stroke:none"
175 d="m 356.95492,366.27175 c -0.0106,-0.008 -0.0174,-0.0199 -0.0279,-0.0278 -0.0124,-0.01 -0.028,-0.015 -0.0403,-0.0249 z"
176 id="path4157" />
177 <path
178 inkscape:connector-curvature="0"
179 style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:15px;line-height:125%;font-family:Ubuntu;-inkscape-font-specification:Ubuntu;text-align:center;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;display:inline;fill:#808080;fill-opacity:1;stroke:none"
180 d="m 356.9482,390.2576 -0.0681,0.0528 c 0.0123,-0.01 0.0279,-0.0151 0.0403,-0.0249 0.0105,-0.008 0.0173,-0.0199 0.0279,-0.0278 z"
181 id="path4344" />
182 <path
183 inkscape:connector-curvature="0"
184 style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#191919;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:7.49851656;marker:none;enable-background:accumulate"
185 d="m 389.3233,365.74223 -27.47507,27.08241 -0.0691,0.0422 c -0.18999,0.11899 -1.29082,0.77766 -3.16016,1.69697 -1.86935,0.91931 -4.42819,2.05074 -7.29726,2.96034 l -1.35408,0.42976 0.42801,-1.35451 c 0.91016,-2.87043 2.04299,-5.42982 2.96247,-7.2982 0.91948,-1.86838 1.57833,-2.96718 1.69668,-3.15604 l 0.0413,-0.0691 27.09121,-27.46516 6.61206,6.60656 0.52397,0.52473 z m -25.54712,2.68886 -1.96538,0 0,-9.82303 1.96538,0 0,9.82303 z m -2.92792,23.2712 -4.6294,-4.62662 c -0.0872,0.14609 -0.70887,1.19142 -1.53834,2.87689 -0.39818,0.8091 -0.83107,1.78008 -1.26771,2.83947 l 1.71683,1.71615 c 1.05904,-0.43598 2.02949,-0.86831 2.83868,-1.26625 1.68563,-0.82896 2.73232,-1.45159 2.87994,-1.53964 z"
186 id="rect3972-1" />
187 <rect
188 style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#191919;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:7.5;marker:none;enable-background:accumulate"
189 id="rect3974-0"
190 width="15.71686"
191 height="1.9653834"
192 x="-374.32489"
193 y="-357.88004"
194 transform="matrix(0,-1,-1,0,0,0)" />
195 <rect
196 style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#191919;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:7.5;marker:none;enable-background:accumulate"
197 id="rect3976-5"
198 width="21.610626"
199 height="1.9653106"
200 x="-380.21872"
201 y="-351.98389"
202 transform="matrix(0,-1,-1,0,0,0)" />
203 </g>
204 </g>
205 </g>
206 </g>
207</svg>
0208
=== modified file 'nav/img/mode/bike.svg'
--- nav/img/mode/bike.svg 2016-03-26 18:53:17 +0000
+++ nav/img/mode/bike.svg 2016-05-22 10:44:41 +0000
@@ -10,36 +10,41 @@
10 version="1.0"10 version="1.0"
11 x="0px"11 x="0px"
12 y="0px"12 y="0px"
13 viewBox="0 0 100 61.284"13 viewBox="0 0 96 95.999999"
14 enable-background="new 0 0 100 61.284"14 enable-background="new 0 0 100 61.284"
15 xml:space="preserve"15 xml:space="preserve"
16 id="svg2"16 id="svg2"
17 inkscape:version="0.91 r13725"17 inkscape:version="0.91 r13725"
18 sodipodi:docname="noun_536.svg"><metadata18 sodipodi:docname="bike.svg"
19 width="96"
20 height="96"
21 shape-rendering="crispEdges"><metadata
19 id="metadata10"><rdf:RDF><cc:Work22 id="metadata10"><rdf:RDF><cc:Work
20 rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type23 rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
21 rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs24 rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
22 id="defs8" /><sodipodi:namedview25 id="defs8" /><sodipodi:namedview
23 pagecolor="#ffffff"26 pagecolor="#c8c8c8"
24 bordercolor="#666666"27 bordercolor="#818181"
25 borderopacity="1"28 borderopacity="1"
26 objecttolerance="10"29 objecttolerance="10"
27 gridtolerance="10"30 gridtolerance="10"
28 guidetolerance="10"31 guidetolerance="10"
29 inkscape:pageopacity="0"32 inkscape:pageopacity="0"
30 inkscape:pageshadow="2"33 inkscape:pageshadow="2"
31 inkscape:window-width="1280"34 inkscape:window-width="1366"
32 inkscape:window-height="854"35 inkscape:window-height="744"
33 id="namedview6"36 id="namedview6"
34 showgrid="false"37 showgrid="false"
35 inkscape:zoom="3.8509235"38 inkscape:zoom="2.7230142"
36 inkscape:cx="17.020898"39 inkscape:cx="-6.8710741"
37 inkscape:cy="30.642"40 inkscape:cy="30.019466"
38 inkscape:window-x="0"41 inkscape:window-x="0"
39 inkscape:window-y="24"42 inkscape:window-y="0"
40 inkscape:window-maximized="1"43 inkscape:window-maximized="1"
41 inkscape:current-layer="svg2" /><path44 inkscape:current-layer="svg2"
42 d="m 80.596,22.157 c -2.17,0 -4.255,0.364 -6.205,1.024 -1.512,-3.352 -3.279,-7.274 -5.348,-11.878 l 1.32,-3.63 4.537,-0.083 0,-3.795 -17.078,0 c -1.494,2.044 0.605,2.035 8.168,3.712 l -1.32,3.713 -33.743,0 C 33.2,3.281 31.916,3.859 42.147,3.877 L 42.147,0 C 28.063,0.137 30.505,-1.45 22.963,22.81 21.809,22.595 20.62,22.477 19.403,22.477 8.704,22.477 0,31.182 0,41.881 0,52.58 8.704,61.284 19.403,61.284 c 10.7,0 19.404,-8.704 19.404,-19.403 0,-8.006 -4.875,-14.895 -11.812,-17.855 0.422,-1.328 0.876,-2.746 1.363,-4.261 28.386,29.941 17.737,25.087 33.012,25.694 0.073,0 0.143,-0.001 0.216,-0.002 1.809,8.839 9.646,15.508 19.01,15.508 C 91.296,60.965 100,52.261 100,41.562 100,30.863 91.296,22.157 80.596,22.157 Z M 34.268,41.881 c 0,8.196 -6.668,14.864 -14.864,14.864 -8.196,0 -14.865,-6.668 -14.865,-14.864 0,-8.196 6.668,-14.864 14.864,-14.864 0.739,0 1.465,0.056 2.175,0.161 -4.735,14.932 -4.167,13.232 -4.196,14.491 -0.023,1.062 0.834,1.904 1.912,1.977 1.932,-0.196 1.497,0.124 6.325,-15.261 5.1,2.356 8.649,7.517 8.649,13.496 z M 53.428,40.956 29.951,15.372 62.97,15.313 53.428,40.956 Z m 7.766,0.537 -3.61,-0.011 9.367,-24.588 3.634,8.052 c -5.606,3.39 -9.366,9.536 -9.391,16.547 z M 72.471,29.124 78.075,41.541 65.733,41.506 c 0.02,-5.176 2.699,-9.735 6.738,-12.382 z m 8.125,27.302 c -6.854,0 -12.638,-4.666 -14.348,-10.988 15.471,0.015 16.851,0.808 17.067,-1.876 -0.021,-0.782 -0.312,-1.318 -7.046,-16.22 1.369,-0.418 2.822,-0.645 4.326,-0.645 8.196,0 14.864,6.668 14.864,14.865 0,8.197 -6.667,14.864 -14.863,14.864 z"45 showborder="true"
46 inkscape:showpageshadow="false" /><path
47 d="m 76.14832,56.00316 c -1.9964,0 -3.9146,0.33488 -5.7086,0.94208 -1.39104,-3.08384 -3.01668,-6.69208 -4.92016,-10.92776 l 1.2144,-3.3396 4.17404,-0.07636 0,-3.4914 -15.71176,0 c -1.37448,1.88048 0.5566,1.8722 7.51456,3.41504 l -1.2144,3.41596 -31.04356,0 c 2.091161,-7.30388 0.909881,-6.77212 10.322401,-6.75556 l 0,-3.56684 c -12.95728,0.12604 -10.71064,-1.334 -17.64928,20.9852 C 22.064281,56.40612 20.9704,56.29756 19.85076,56.29756 10.00768,56.29756 2,64.30616 2,74.14924 2,83.99232 10.00768,92 19.85076,92 c 9.844,0 17.851681,-8.00768 17.851681,-17.85076 0,-7.36552 -4.485,-13.7034 -10.86704,-16.4266 0.38824,-1.22176 0.80592,-2.52632 1.25396,-3.92012 26.11512,27.54572 16.31804,23.08004 30.371039,23.63848 0.06716,0 0.13156,-9.2e-4 0.19872,-0.0018 1.66428,8.13188 8.874321,14.26736 17.489201,14.26736 C 85.992321,91.70652 94,83.69884 94,73.85576 94,64.01268 85.992321,56.00316 76.148321,56.00316 Z M 33.52656,74.14924 c 0,7.54032 -6.13456,13.67488 -13.67488,13.67488 -7.54032,0 -13.6758,-6.13456 -13.6758,-13.67488 0,-7.54032 6.13456,-13.67488 13.67488,-13.67488 0.67988,0 1.3478,0.05152 2.001,0.14812 -4.3562,13.73744 -3.83364,12.17344 -3.86032,13.33172 -0.02116,0.97704 0.76728,1.75168 1.75904,1.81884 1.77744,-0.18032 1.37724,0.11408 5.819,-14.04012 4.692,2.16752 7.95708,6.91564 7.95708,12.41632 z m 17.6272,-0.851 L 29.55492,49.76096 59.9324,49.70668 51.15376,73.29824 Z m 7.14472,0.49404 -3.3212,-0.01012 8.61764,-22.62096 3.34328,7.40784 c -5.15752,3.1188 -8.61672,8.77312 -8.63972,15.22324 z M 68.67332,62.4128 73.829,73.83644 62.47436,73.80424 c 0.0184,-4.76192 2.48308,-8.9562 6.19896,-11.39144 z m 7.475,25.11784 c -6.30568,0 -11.62696,-4.29272 -13.20016,-10.10896 14.23332,0.0138 15.50292,0.74336 15.70164,-1.72592 -0.01932,-0.71944 -0.28704,-1.21256 -6.48232,-14.9224 1.25948,-0.38456 2.59624,-0.5934 3.97992,-0.5934 7.54032,0 13.67488,6.13456 13.67488,13.6758 0,7.54124 -6.13364,13.67488 -13.67396,13.67488 z"
43 id="path4"48 id="path4"
44 style="fill:#ffffff"49 style="fill:#ffffff"
45 inkscape:connector-curvature="0" /></svg>50 inkscape:connector-curvature="0" /></svg>
46\ No newline at end of file51\ No newline at end of file
4752
=== modified file 'nav/img/mode/car.svg'
--- nav/img/mode/car.svg 2016-03-26 18:53:17 +0000
+++ nav/img/mode/car.svg 2016-05-22 10:44:41 +0000
@@ -11,17 +11,19 @@
11 version="1.1"11 version="1.1"
12 x="0px"12 x="0px"
13 y="0px"13 y="0px"
14 viewBox="0 0 100 125"14 viewBox="0 0 96 96"
15 enable-background="new 0 0 100 100"15 enable-background="new 0 0 100 100"
16 xml:space="preserve"16 xml:space="preserve"
17 id="svg2"17 id="svg2"
18 inkscape:version="0.91 r13725"18 inkscape:version="0.91 r13725"
19 sodipodi:docname="noun_152445_cc.svg"><metadata19 sodipodi:docname="car.svg"
20 width="96"
21 height="96"><metadata
20 id="metadata18"><rdf:RDF><cc:Work22 id="metadata18"><rdf:RDF><cc:Work
21 rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type23 rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
22 rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs24 rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
23 id="defs16" /><sodipodi:namedview25 id="defs16" /><sodipodi:namedview
24 pagecolor="#ffffff"26 pagecolor="#acacac"
25 bordercolor="#666666"27 bordercolor="#666666"
26 borderopacity="1"28 borderopacity="1"
27 objecttolerance="10"29 objecttolerance="10"
@@ -29,19 +31,19 @@
29 guidetolerance="10"31 guidetolerance="10"
30 inkscape:pageopacity="0"32 inkscape:pageopacity="0"
31 inkscape:pageshadow="2"33 inkscape:pageshadow="2"
32 inkscape:window-width="1280"34 inkscape:window-width="1366"
33 inkscape:window-height="854"35 inkscape:window-height="744"
34 id="namedview14"36 id="namedview14"
35 showgrid="false"37 showgrid="false"
36 inkscape:zoom="1.888"38 inkscape:zoom="1.888"
37 inkscape:cx="-17.266949"39 inkscape:cx="-17.266949"
38 inkscape:cy="62.5"40 inkscape:cy="62.5"
39 inkscape:window-x="0"41 inkscape:window-x="0"
40 inkscape:window-y="24"42 inkscape:window-y="0"
41 inkscape:window-maximized="1"43 inkscape:window-maximized="1"
42 inkscape:current-layer="svg2" /><switch44 inkscape:current-layer="svg2" /><switch
43 id="switch4"45 id="switch4"
44 transform="matrix(1.0943644,0,0,1.0943644,-4.9408658,7.8912164)"><foreignObject46 transform="matrix(1.0244202,0,0,1.0244202,-3.4294271,11.070804)"><foreignObject
45 requiredExtensions="http://ns.adobe.com/AdobeIllustrator/10.0/"47 requiredExtensions="http://ns.adobe.com/AdobeIllustrator/10.0/"
46 x="0"48 x="0"
47 y="0"49 y="0"
4850
=== modified file 'nav/img/mode/walk.svg'
--- nav/img/mode/walk.svg 2016-03-26 18:53:17 +0000
+++ nav/img/mode/walk.svg 2016-05-22 10:44:41 +0000
@@ -10,17 +10,19 @@
10 version="1.0"10 version="1.0"
11 x="0px"11 x="0px"
12 y="0px"12 y="0px"
13 viewBox="0 0 55.74 100"13 viewBox="0 0 95.999997 96"
14 enable-background="new 0 0 55.74 100"14 enable-background="new 0 0 55.74 100"
15 xml:space="preserve"15 xml:space="preserve"
16 id="svg2"16 id="svg2"
17 inkscape:version="0.91 r13725"17 inkscape:version="0.91 r13725"
18 sodipodi:docname="walk.svg"><metadata18 sodipodi:docname="walk.svg"
19 width="96"
20 height="96"><metadata
19 id="metadata12"><rdf:RDF><cc:Work21 id="metadata12"><rdf:RDF><cc:Work
20 rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type22 rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
21 rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs23 rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title /></cc:Work></rdf:RDF></metadata><defs
22 id="defs10" /><sodipodi:namedview24 id="defs10" /><sodipodi:namedview
23 pagecolor="#ffffff"25 pagecolor="#858585"
24 bordercolor="#666666"26 bordercolor="#666666"
25 borderopacity="1"27 borderopacity="1"
26 objecttolerance="10"28 objecttolerance="10"
@@ -28,22 +30,22 @@
28 guidetolerance="10"30 guidetolerance="10"
29 inkscape:pageopacity="0"31 inkscape:pageopacity="0"
30 inkscape:pageshadow="2"32 inkscape:pageshadow="2"
31 inkscape:window-width="1615"33 inkscape:window-width="1366"
32 inkscape:window-height="1026"34 inkscape:window-height="744"
33 id="namedview8"35 id="namedview8"
34 showgrid="false"36 showgrid="false"
35 inkscape:zoom="2.36"37 inkscape:zoom="2.36"
36 inkscape:cx="-89.079151"38 inkscape:cx="-89.079151"
37 inkscape:cy="50"39 inkscape:cy="50"
38 inkscape:window-x="65"40 inkscape:window-x="0"
39 inkscape:window-y="24"41 inkscape:window-y="0"
40 inkscape:window-maximized="1"42 inkscape:window-maximized="1"
41 inkscape:current-layer="svg2" /><path43 inkscape:current-layer="svg2" /><path
42 d="m 24.471,13.769 c -3.862,0 -6.884,-3.025 -6.884,-6.885 0,-3.862 3.022,-6.884 6.884,-6.884 3.86,0 6.885,3.022 6.885,6.884 0,3.86 -3.025,6.885 -6.885,6.885 z"44 d="m 44.51332,14.66748 c -3.55304,0 -6.33328,-2.783 -6.33328,-6.3342 C 38.18004,4.78024 40.96028,2 44.51332,2 c 3.5512,0 6.3342,2.78024 6.3342,6.33328 0,3.5512 -2.783,6.3342 -6.3342,6.3342 z"
43 id="path4"45 id="path4"
44 style="fill:#ffffff"46 style="fill:#ffffff"
45 inkscape:connector-curvature="0" /><path47 inkscape:connector-curvature="0" /><path
46 d="M 54.491,51.724 49.979,51.303 49.877,35.25 41.653,30.046 c 0,0 1.333,10.545 1.333,16.085 0,4.831 0.172,8.736 0.172,8.736 L 53.686,96.918 46.251,100 34.46,61.549 26.265,71.973 16.926,98.31 8.532,94.955 17.957,66.99 28.294,50.665 25.393,29.266 18.933,42.81 2.311,48.518 0,44.319 15.234,35.432 c 0,0 3.691,-9.819 6.711,-15.962 1.027,-2.091 5.196,-2.774 6.894,-2.901 4.896,-0.362 7.428,1.296 11.488,3.432 4.055,2.13 15.413,10.727 15.413,10.727 l -1.249,20.996 z"48 d="M 72.13172,49.58608 67.98068,49.19876 67.88684,34.43 60.32076,29.64232 c 0,0 1.22636,9.7014 1.22636,14.7982 0,4.44452 0.15824,8.03712 0.15824,8.03712 L 71.39112,91.16456 64.55092,94 53.7032,58.62508 46.1638,68.21516 37.57192,92.4452 29.84944,89.3586 38.52044,63.6308 48.03048,48.6118 45.36156,28.92472 39.41836,41.3852 24.12612,46.63656 22,42.77348 36.01528,34.59744 c 0,0 3.39572,-9.03348 6.17412,-14.68504 0.94484,-1.92372 4.78032,-2.55208 6.34248,-2.66892 4.50432,-0.33304 6.83376,1.19232 10.56896,3.15744 3.7306,1.9596 14.17996,9.86884 14.17996,9.86884 l -1.14908,19.31632 z"
47 id="path6"49 id="path6"
48 style="fill:#ffffff"50 style="fill:#ffffff"
49 inkscape:connector-curvature="0" /></svg>51 inkscape:connector-curvature="0" /></svg>
50\ No newline at end of file52\ No newline at end of file
5153
=== modified file 'nav/index.html'
--- nav/index.html 2016-04-24 16:15:59 +0000
+++ nav/index.html 2016-05-22 10:44:41 +0000
@@ -103,11 +103,6 @@
103 <span id="txt_mapspeed"></span>103 <span id="txt_mapspeed"></span>
104 </div>104 </div>
105 105
106 <!-- Error getting radar -->
107 <div id="error_get_radars" style="display:none;">
108 <span data-localize="Error getting speed cameras">Error getting speed cameras</span>
109 </div>
110
111 <!-- Warning for long routes -->106 <!-- Warning for long routes -->
112 <div id="popup_longroute" style="display:none;" data-role="dialog">107 <div id="popup_longroute" style="display:none;" data-role="dialog">
113 <section>108 <section>
@@ -524,11 +519,13 @@
524 519
525 function qml_save_pos() {520 function qml_save_pos() {
526 if (ol.proj.transform(map.getView().getCenter(), 'EPSG:3857', 'EPSG:4326')[1].toFixed(6) == 50.009167 && ol.proj.transform(map.getView().getCenter(), 'EPSG:3857', 'EPSG:4326')[0].toFixed(6) == 4.666389)521 if (ol.proj.transform(map.getView().getCenter(), 'EPSG:3857', 'EPSG:4326')[1].toFixed(6) == 50.009167 && ol.proj.transform(map.getView().getCenter(), 'EPSG:3857', 'EPSG:4326')[0].toFixed(6) == 4.666389)
527 return;522 return;
528
529 window.location = 'http://save_pos?' + ol.proj.transform(map.getView().getCenter(), 'EPSG:3857', 'EPSG:4326')[1] + '/' + ol.proj.transform(map.getView().getCenter(), 'EPSG:3857', 'EPSG:4326')[0] + '/' + this.map.getView().getZoom();523 window.location = 'http://save_pos?' + ol.proj.transform(map.getView().getCenter(), 'EPSG:3857', 'EPSG:4326')[1] + '/' + ol.proj.transform(map.getView().getCenter(), 'EPSG:3857', 'EPSG:4326')[0] + '/' + this.map.getView().getZoom();
530 }524 }
531525
526 function qml_show_notification(mode, message) {
527 window.location = 'http://show_notification?' + mode.toString() + '/' + message.toString();
528 }
532529
533 // QML events returning530 // QML events returning
534 function calc2coord(lat, lng) {531 function calc2coord(lat, lng) {
535532
=== modified file 'qml/Main.qml'
--- qml/Main.qml 2016-04-25 19:52:54 +0000
+++ qml/Main.qml 2016-05-22 10:44:41 +0000
@@ -150,9 +150,6 @@
150 property bool favPopup: false150 property bool favPopup: false
151 property bool onLoadingExecuted: false151 property bool onLoadingExecuted: false
152152
153 onCurrentLatChanged: console.log("CURRENT Lat changed: " + mainPageStack.currentLat)
154
155
156 property string usContext: "messaging://"153 property string usContext: "messaging://"
157 // Workaround: as long as map keeps a webcontainer this function handles js events to the webview.154 // Workaround: as long as map keeps a webcontainer this function handles js events to the webview.
158 function executeJavaScript(code) {155 function executeJavaScript(code) {
@@ -320,7 +317,7 @@
320 goThereActionPopover.phone = params[5];317 goThereActionPopover.phone = params[5];
321 318
322 if (params[6] !== "none")319 if (params[6] !== "none")
323 goThereActionPopover.poiName = params[6].replace(/¿¿¿/g, "\/");320 goThereActionPopover.poiName = decodeURIComponent(params[6]);
324321
325 mainPageStack.favPopup = false;322 mainPageStack.favPopup = false;
326 goThereActionPopover.show();323 goThereActionPopover.show();
@@ -366,8 +363,23 @@
366 navApp.settings.prevLng = params[1];363 navApp.settings.prevLng = params[1];
367 navApp.settings.prevZoom = params[2];364 navApp.settings.prevZoom = params[2];
368 break;365 break;
366
367 case "http://show_notification/":
368 if (params[1] === "speed_camera_error") {
369 notifiactionBar.text = i18n.tr("Error getting speed cameras!");
370 }
371 switch (params[0]) {
372 case "info":
373 notifiactionBar.info();
374 break;
375 case "warning":
376 notifiactionBar.warning();
377 break;
378 case "critical":
379 notifiactionBar.critical();
380 }
381 notificationBarTimer.start();
369 }382 }
370
371 request.action = Oxide.NavigationRequest.ActionReject;383 request.action = Oxide.NavigationRequest.ActionReject;
372 }384 }
373385
@@ -507,6 +519,19 @@
507 }519 }
508 }520 }
509521
522 Timer {
523 id: notificationBarTimer
524 interval: 8000
525 repeat: false
526 onTriggered: {
527 notifiactionBar.visible = false
528 }
529 }
530
531 NotificationBar {
532 id: notifiactionBar
533 }
534
510 XmlListModel {535 XmlListModel {
511 id: reverseXmlModel536 id: reverseXmlModel
512537
@@ -617,47 +642,56 @@
617642
618 Component {643 Component {
619 id: routeMenu644 id: routeMenu
620 Item {645 Column {
621 width: parent.width
622 height: routePageGrid.height646 height: routePageGrid.height
623647 spacing: 0
624 Component.onCompleted: {648 Component.onCompleted: {
625 mainPageStack.executeJavaScript("qml_set_route_status();")649 mainPageStack.executeJavaScript("qml_set_route_status();")
626 }650 }
627651
628 CustomGridView {652 Row {
629 id: routePageGrid653 id: gridRow
630654 spacing: units.gu(2)
631 ListModel {
632 id: routePageModel
633 Component.onCompleted: initialize()
634
635 function initialize() {
636 routePageModel.append({mode: "DESTINATION", text: i18n.tr("NearBy Destination"), iconName: "location"})
637 routePageModel.append({mode: "CANCEL", text: i18n.tr("Cancel Route"), iconName: "dialog-error-symbolic"})
638 }
639 }
640
641 itemWidth: units.gu(9)
642 model: routePageModel
643 anchors.horizontalCenter: parent.horizontalCenter655 anchors.horizontalCenter: parent.horizontalCenter
644656
645 delegate: GridDelegate {657 Loader {
646 id: delegate658 id: poiQuickAccessLoader
647659 sourceComponent: POIQuickAccessGridView {}
648 width: units.gu(9)660 }
649 title: model.text661
650 icon.name: model.iconName662 CustomGridView {
651663 id: routePageGrid
652 onClicked: {664
653 if (model.mode === "DESTINATION") {665 ListModel {
654 mainPageStack.addPageToNextColumn(mainPageStack.primaryPage, Qt.resolvedUrl("PoiPage.qml"), {"lat": mainPageStack.endLat, "lng": mainPageStack.endLng})666 id: routePageModel
655 } else if (model.mode === "CANCEL") {667 Component.onCompleted: initialize()
656 mainPageStack.routeState = 'no';668
657 mainPageStack.executeJavaScript("click_cancel_route();");669 function initialize() {
658 }670 routePageModel.append({mode: "DESTINATION", text: i18n.tr("NearBy Destination"), iconName: "location"})
659 goThereActionPopover.showMenu = false671 routePageModel.append({mode: "CANCEL", text: i18n.tr("Cancel Route"), iconName: "dialog-error-symbolic"})
660 goThereActionPopover.hide()672 }
673 }
674
675 itemWidth: units.gu(8)
676 model: routePageModel
677
678 delegate: GridDelegate {
679 id: delegate
680
681 width: units.gu(8)
682 title: model.text
683 icon.name: model.iconName
684
685 onClicked: {
686 if (model.mode === "DESTINATION") {
687 mainPageStack.addPageToNextColumn(mainPageStack.primaryPage, Qt.resolvedUrl("PoiPage.qml"), {"lat": mainPageStack.endLat, "lng": mainPageStack.endLng})
688 } else if (model.mode === "CANCEL") {
689 mainPageStack.routeState = 'no';
690 mainPageStack.executeJavaScript("click_cancel_route();");
691 }
692 goThereActionPopover.showMenu = false
693 goThereActionPopover.hide()
694 }
661 }695 }
662 }696 }
663 }697 }
@@ -706,9 +740,9 @@
706 mainPageStack.favPopup = !mainPageStack.favPopup;740 mainPageStack.favPopup = !mainPageStack.favPopup;
707 mainPageStack.showSideBar()741 mainPageStack.showSideBar()
708 var incubator = mainPageStack.addPageToNextColumn(mainPageStack.primaryPage, Qt.resolvedUrl("SearchPage.qml"), {favLat: mainPageStack.clickedLat, favLng: mainPageStack.clickedLng, favName: ""});742 var incubator = mainPageStack.addPageToNextColumn(mainPageStack.primaryPage, Qt.resolvedUrl("SearchPage.qml"), {favLat: mainPageStack.clickedLat, favLng: mainPageStack.clickedLng, favName: ""});
709 if (incubator && incubator.status == Component.Loading) {743 if (incubator && incubator.status === Component.Loading) {
710 incubator.onStatusChanged = function(status) {744 incubator.onStatusChanged = function(status) {
711 if (status == Component.Ready) {745 if (status === Component.Ready) {
712 incubator.object.addFavorite()746 incubator.object.addFavorite()
713 }747 }
714 }748 }
715749
=== modified file 'qml/PoiDetailsPage.qml'
--- qml/PoiDetailsPage.qml 2016-04-28 16:07:19 +0000
+++ qml/PoiDetailsPage.qml 2016-05-22 10:44:41 +0000
@@ -52,7 +52,7 @@
52 XmlListModel {52 XmlListModel {
53 id: poiDetailsModel53 id: poiDetailsModel
5454
55 readonly property string baseUrl: "http://nominatim.openstreetmap.org/reverse?format=xml&addressdetails=1&email=costales.marcos@gmail.com&extratags=1"55 readonly property string baseUrl: "https://nominatim.openstreetmap.org/reverse?format=xml&addressdetails=1&email=costales.marcos@gmail.com&extratags=1"
56 readonly property string url: baseUrl + "&osm_type=" + osm_type + "&osm_id=" + osm_id56 readonly property string url: baseUrl + "&osm_type=" + osm_type + "&osm_id=" + osm_id
5757
58 property string lat58 property string lat
5959
=== modified file 'qml/PoiListPage.qml'
--- qml/PoiListPage.qml 2016-04-30 09:20:05 +0000
+++ qml/PoiListPage.qml 2016-05-22 10:44:41 +0000
@@ -160,7 +160,7 @@
160 if (status === XmlListModel.Loading) { statusLabel.text = i18n.tr("Searching…") }160 if (status === XmlListModel.Loading) { statusLabel.text = i18n.tr("Searching…") }
161 }161 }
162162
163 readonly property string baseUrl: "http://nominatim.openstreetmap.org/search?format=xml&bounded=1&limit=50&email=costales.marcos@gmail.com&extratags=1"163 readonly property string baseUrl: "https://nominatim.openstreetmap.org/search?format=xml&bounded=1&limit=50&email=costales.marcos@gmail.com&extratags=1"
164 readonly property double geoDist: navApp.settings.unit === 0 ? 0.01 : 0.01 / 0.621371192164 readonly property double geoDist: navApp.settings.unit === 0 ? 0.01 : 0.01 / 0.621371192
165 // geographic distance ~1.1km / ~1.1mi165 // geographic distance ~1.1km / ~1.1mi
166 // rough estimation only. Could be redefined.166 // rough estimation only. Could be redefined.
167167
=== added file 'qml/PoiQuickAccessPage.qml'
--- qml/PoiQuickAccessPage.qml 1970-01-01 00:00:00 +0000
+++ qml/PoiQuickAccessPage.qml 2016-05-22 10:44:41 +0000
@@ -0,0 +1,185 @@
1/*
2 * GPS Navigation http://launchpad.net/unav
3 * Copyright (C) 2015-2016 Marcos Alvarez Costales https://launchpad.net/~costales
4 * Copyright (C) 2015-2016 JkB https://launchpad.net/~joergberroth
5 * Copyright (C) 2016 Nekhelesh Ramananthan http://launchpad.net/~nik90
6 *
7 * GPS Navigation is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * GPS Navigation is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 */
17
18import QtQuick 2.4
19import Ubuntu.Components 1.3
20import Ubuntu.Components.Popups 1.3
21import QtQuick.XmlListModel 2.0
22import QtQuick.LocalStorage 2.0
23import "components"
24import "js/PoiCategories.js" as Categories
25import "js/db.js" as UnavDB
26
27Page {
28 id: poiQuickAccessPage
29
30 property string unit: navApp.settings.unit === 0 ? "km" : "mi"
31 property var factorList: ["1", "5", "15", "30", "50"]
32
33 readonly property int maxQuickAccessItems: 5
34
35 property string mode: "Car"
36
37 Component.onCompleted: {
38 switch (navApp.settings.routingMode) {
39 case 0:
40 poiQuickAccessPage.mode = "Car";
41 break;
42 case 1:
43 poiQuickAccessPage.mode = "Walk";
44 break;
45 case 2:
46 poiQuickAccessPage.mode = "Bike";
47 break;
48 }
49 categoryListModel.initialize()
50 }
51
52 Component.onDestruction: {
53 // Hide 2nd column when returning to the map to avoid an empty white column
54 if (mainPageStack.columns === 1)
55 mainPageStack.hideSideBar()
56 }
57
58 header: UNavHeader {
59 id: poiQuickAccessHeader
60
61 flickable: categoryList
62
63 title: i18n.tr("Quick Access: ") + i18n.tr(mode)
64
65 trailingActionBar {
66 actions: [
67 CloseHeaderAction {}
68 ]
69 }
70
71 extension: UNavPageSection {
72 id: distanceSections
73 anchors {
74 left: parent.left
75 bottom: parent.bottom
76 }
77
78 model: [factorList[0]+unit, factorList[1]+unit, factorList[2]+unit, factorList[3]+unit, factorList[4]+unit]
79 selectedIndex: 1
80 }
81 }
82
83 ListModel {
84 id: categoryListModel
85 property var indices: []
86 function initialize() {
87 categoryListModel.clear();
88 categoryListModel.indices = [];
89 var res = UnavDB.getQuickAccessItems(poiQuickAccessPage.mode);
90 var len = res.rows.length;
91 for ( var i = 0; i < len; ++i) {
92 categoryListModel.indices.push( res.rows.item(i).type )
93 }
94 Categories.data.forEach( function(category) {
95 categoryListModel.append(category);
96 });
97 categoryList.update()
98 }
99 }
100
101 SortFilterModel {
102 id: sortedCategoryListModel
103 model: categoryListModel
104 filter.property: "label"
105 filter.pattern: RegExp("", "gi")
106 }
107
108 ListView {
109 id: categoryList
110
111 model: sortedCategoryListModel
112 anchors.fill: parent
113 clip: true
114
115 section.property: "theme"
116 section.criteria: ViewSection.FullString
117 section.labelPositioning: ViewSection.CurrentLabelAtStart + ViewSection.InlineLabels
118 section.delegate: Rectangle {
119 width: parent.width
120 height: sectionHeader.height
121
122 ListItemHeader {
123 id: sectionHeader
124 title: section
125 }
126 }
127
128 delegate: ListItem {
129 id: poiItem
130 divider.visible: true
131 height: poiItemLayout.height
132
133 ListItemLayout {
134 id: poiItemLayout
135 title.text: label
136
137 Icon {
138 source: Qt.resolvedUrl("../nav/img/poi/" + model.en_label + ".svg")
139 height: units.gu(2.5)
140 width: height
141 SlotsLayout.position: SlotsLayout.Leading
142 }
143
144 CheckBox {
145 id: quickAccessCheckBox
146 checked: categoryListModel.indices.indexOf(model.en_label) > -1
147 SlotsLayout.position: SlotsLayout.Trailing
148 onClicked: {
149 var count = UnavDB.countQuickAccessItems(poiQuickAccessPage.mode).rows.item(0).count;
150 if (!quickAccessCheckBox.checked) {
151 UnavDB.removeQuickAccessItem( poiQuickAccessPage.mode, model.en_label )
152 } else if (quickAccessCheckBox.checked && count >= poiQuickAccessPage.maxQuickAccessItems ){
153 quickAccessCheckBox.checked = false;
154 PopupUtils.open(maxSelectedDialogComponent);
155 } else if (quickAccessCheckBox.checked && count < poiQuickAccessPage.maxQuickAccessItems ){
156 UnavDB.saveToQuickAccessItem(poiQuickAccessPage.mode, model.en_label, model.clause, factorList[header.extension.selectedIndex])
157 }
158 }
159 }
160 }
161 }
162 }
163
164 Scrollbar {
165 flickableItem: categoryList
166 align: Qt.AlignTrailing
167 }
168
169 Component {
170 id: maxSelectedDialogComponent
171 Dialog {
172 id: maxSelectedDialog
173 title: i18n.tr("Selection")
174 //TRANSLATORS: argument is a number > 1.
175 text: i18n.tr("Max. %1 POIs can be selected.").arg(poiQuickAccessPage.maxQuickAccessItems)
176
177 Button {
178 text: i18n.tr("OK")
179 color: UbuntuColors.orange
180 onClicked: PopupUtils.close(maxSelectedDialog);
181 }
182 }
183 }
184}
185
0186
=== added file 'qml/components/NotificationBar.qml'
--- qml/components/NotificationBar.qml 1970-01-01 00:00:00 +0000
+++ qml/components/NotificationBar.qml 2016-05-22 10:44:41 +0000
@@ -0,0 +1,88 @@
1/*
2 * GPS Navigation http://launchpad.net/unav
3 * Copyright (C) 2015-2016 JkB https://launchpad.net/~joergberroth
4 * Copyright (C) 2015-2016 Marcos Alvarez Costales https://launchpad.net/~costales
5 *
6 * GPS Navigation is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * GPS Navigation is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 */
16
17import QtQuick 2.4
18import Ubuntu.Components 1.3
19
20Rectangle {
21 id: notificationRectangle
22
23 property alias text: notificationLabel.text
24
25 signal info()
26 signal warning()
27 signal critical()
28
29 onInfo: {
30 notificationLabel.color = UbuntuColors.slate
31 notificationRectangle.color = "#FFFFFF"
32 notificationRectangle.visible = true;
33 notificationIcon.name = ""
34 notificationLabel.fontSize = "medium"
35 notificationRectangle.height = notificationLabel.height + units.gu(1)
36 }
37 onWarning: {
38 notificationLabel.color = "#FFFFFF"
39 notificationRectangle.color = UbuntuColors.orange;
40 notificationRectangle.visible = true;
41 notificationLabel.fontSize = "large"
42 notificationIcon.name = "dialog-warning-symbolic"
43 notificationRectangle.height = notificationLabel.height + units.gu(4)
44 }
45 onCritical: {
46 notificationLabel.color = "#FFFFFF"
47 notificationRectangle.color = UbuntuColors.red
48 notificationRectangle.visible = true;
49 notificationLabel.fontSize = "large"
50 notificationIcon.name = "dialog-error-symbolic"
51 notificationRectangle.height = notificationLabel.height + units.gu(4)
52 }
53
54 width: parent.width
55 visible: false
56
57 anchors {
58 top: goThereActionPopover.isShown ? goThereActionPopover.bottom : navigationPage.header.bottom
59 }
60
61 Icon {
62 id: notificationIcon
63 width: units.gu(3.5)
64 height: width
65 anchors {
66 verticalCenter: parent.verticalCenter
67 left: parent.left
68 leftMargin: units.gu(2)
69 }
70 visible: name !== ""
71 color: "#FFFFFF"
72
73 }
74
75 Label {
76 id: notificationLabel
77 anchors {
78 left: notificationIcon.visible ? notificationIcon.right : parent.left
79 margins: units.gu(1)
80 right: parent.right
81 verticalCenter: parent.verticalCenter
82 }
83 horizontalAlignment: Text.AlignHCenter
84 maximumLineCount: 3
85 wrapMode: Text.WordWrap
86 elide: Text.ElideRight
87 }
88}
089
=== added file 'qml/components/POIQuickAccessGridView.qml'
--- qml/components/POIQuickAccessGridView.qml 1970-01-01 00:00:00 +0000
+++ qml/components/POIQuickAccessGridView.qml 2016-05-22 10:44:41 +0000
@@ -0,0 +1,184 @@
1/*
2 * GPS Navigation http://launchpad.net/unav
3 * Copyright (C) 2015-2016 JkB https://launchpad.net/~joergberroth
4 * Copyright (C) 2015-2016 Marcos Alvarez Costales https://launchpad.net/~costales
5 *
6 * GPS Navigation is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * GPS Navigation is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 */
16
17import QtQuick 2.4
18import Ubuntu.Components 1.3
19import QtQuick.LocalStorage 2.0
20import "../js/db.js" as UnavDB
21import QtQuick.XmlListModel 2.0
22
23Grid {
24 id: gridView
25
26 readonly property int maxQuickAccessItems: 5
27
28 property int itemWidth: units.gu(3.5)
29
30 rowSpacing: units.gu(1)
31 columnSpacing: units.gu(2)
32 width: (columns * itemWidth) + columnSpacing * (columns - 1)
33
34 columns: 2
35 rows: 2
36 layoutDirection: Qt.RightToLeft
37
38 ListModel {
39 id: quickAccessModel
40 function initialize() {
41 quickAccessModel.clear();
42 var mode;
43 if (navApp.settings.routingMode === 0) {mode = "Car"}
44 if (navApp.settings.routingMode === 1) {mode = "Walk"}
45 if (navApp.settings.routingMode === 2) {mode = "Bike"}
46 var res = UnavDB.getQuickAccessItems( mode )
47 var len = res.rows.length;
48 for ( var i = 0; i < (len <= maxQuickAccessItems ? len : maxQuickAccessItems) ; ++i) {
49 quickAccessModel.append(
50 {
51 label: i18n.tr(res.rows.item(i).type),
52 en_label: res.rows.item(i).type,
53 clause: res.rows.item(i).clause,
54 distance: res.rows.item(i).distance
55 }
56 );
57 }
58 quickAccessModel.insert(0,{label:"add"});
59 var gridcolumns = Math.ceil(quickAccessModel.count/2);
60 gridView.columns = gridcolumns > 2 ? gridcolumns : 2
61 }
62 Component.onCompleted: initialize()
63 }
64
65 XmlListModel {
66 id: poiXmlModel
67 property string distance
68 property string clause
69 function allPOI() {
70 var allPOI = [];
71 for (var i = 0; i < poiXmlModel.count; i++) {
72 allPOI.push({
73 title: poiXmlModel.get(i).name.split(',')[0],
74 lat: parseFloat(poiXmlModel.get(i).lat),
75 lng: parseFloat(poiXmlModel.get(i).lng),
76 osm_id: poiXmlModel.get(i).osm_id,
77 osm_type: poiXmlModel.get(i).osm_type.charAt(0).toUpperCase(),
78 phone: poiXmlModel.get(i).phone,
79 distance: poiXmlModel.distance
80 });
81 }
82 return allPOI;
83 }
84
85 onStatusChanged: {
86
87 if (status === XmlListModel.Error) {
88 console.log(errorString());
89 source = "";
90 notificationBarTimer.start();
91 notifiactionBar.text = i18n.tr("Error getting results. Please, check your data connection.");
92 notifiactionBar.critical();
93 }
94 if (status === XmlListModel.Ready && count === 0) {
95 notificationBarTimer.start();
96 notifiactionBar.text = i18n.tr("Sorry, no results found nearby.");
97 notifiactionBar.info();
98 }
99 if (status === XmlListModel.Ready && count >> 0) {
100 notifiactionBar.visible = false;
101 mainPageStack.executeJavaScript("ui.markers_POI_set(" + JSON.stringify(poiXmlModel.allPOI()) + ")");
102 mainPageStack.center_onpos = 1;
103 goThereActionPopover.hide();
104 }
105 }
106
107 readonly property string baseUrl: "https://nominatim.openstreetmap.org/search?format=xml&bounded=1&limit=50&email=costales.marcos@gmail.com&extratags=1"
108 readonly property double geoDist: navApp.settings.unit === 0 ? 0.01 : 0.01 / 0.621371192
109 // geographic distance ~1.1km / ~1.1mi
110 // rough estimation only. Could be redefined.
111
112 function search() {
113 // Boxed area in which to search for PoI
114 var bbox = ( Number(mainPageStack.currentLng) - geoDist*distance).toString() + ","
115 + ( Number(mainPageStack.currentLat) - geoDist*distance).toString() + ","
116 + ( Number(mainPageStack.currentLng) + geoDist*distance).toString() + ","
117 + ( Number(mainPageStack.currentLat) + geoDist*distance).toString();
118 source = (baseUrl + "&q=" + clause + "&viewbox=" + bbox);
119 }
120 function clear() {
121 source = "";
122 }
123
124 source: ""
125 query: "/searchresults/place"
126
127 XmlRole { name: "osm_type"; query: "@osm_type/string()"; }
128 XmlRole { name: "osm_id"; query: "@osm_id/string()"; }
129 XmlRole { name: "name"; query: "@display_name/string()"; }
130 XmlRole { name: "phone"; query: "extratags/tag[@key='phone']/@value/string()"; }
131 XmlRole { name: "lat"; query: "@lat/string()"; }
132 XmlRole { name: "lng"; query: "@lon/string()"; }
133 }
134
135 Repeater {
136
137 model: quickAccessModel
138
139 delegate: AbstractButton {
140 id: button
141 width: units.gu(4)
142 height: width
143 opacity: button.pressed ? 0.5 : (enabled ? 1 : 0.2)
144
145 Behavior on opacity {
146 UbuntuNumberAnimation { }
147 }
148
149 UbuntuShape {
150 id: shape
151
152 aspect: UbuntuShape.Flat
153 anchors.fill: parent
154 radius: "medium"
155 }
156
157 Icon {
158 source: model.label !== "add" ? Qt.resolvedUrl("../../nav/img/poi/" + model.en_label + ".svg"): "../../nav/img/header/poiConfig.svg"
159 opacity: 0.6 //model.label === "add" ? 1 :0.6
160 width: units.gu(3.25)
161 enabled: navigationPage.buttonsEnabled
162
163 anchors.centerIn: parent
164 color: UbuntuColors.slate
165 }
166 onClicked: {
167 if (model.label === "add") {
168 goThereActionPopover.hide()
169 mainPageStack.showSideBar()
170 mainPageStack.addPageToNextColumn(mainPageStack.primaryPage, Qt.resolvedUrl("../PoiQuickAccessPage.qml"))
171 } else {
172 poiXmlModel.clear()
173 notifiactionBar.text = i18n.tr("Searching…")
174 notifiactionBar.info()
175 poiXmlModel.distance = model.distance;
176 poiXmlModel.clause = model.clause;
177 poiXmlModel.search();
178 mainPageStack.executeJavaScript("ui.markers_POI_clear()")
179 }
180 }
181 }
182 }
183}
184
0185
=== modified file 'qml/js/db.js'
--- qml/js/db.js 2016-04-17 14:08:53 +0000
+++ qml/js/db.js 2016-05-22 10:44:41 +0000
@@ -20,12 +20,15 @@
2020
21function openDB() {21function openDB() {
22 if (db === null) {22 if (db === null) {
23 db = LocalStorage.openDatabaseSync("unav_db", "0.1", "Favorites and history", 1000);23 db = LocalStorage.openDatabaseSync("unav_db", "0.1", "Favorites and history", 1000);
24 db.transaction(function(tx){24 db.transaction(function(tx){
25 tx.executeSql('CREATE TABLE IF NOT EXISTS favorites(key TEXT UNIQUE, lat TEXT, lng TEXT)');25 tx.executeSql('CREATE TABLE IF NOT EXISTS favorites( key TEXT UNIQUE, lat TEXT, lng TEXT)');
26 tx.executeSql('CREATE TABLE IF NOT EXISTS nearByHistory(id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, type TEXT UNIQUE, clause TEXT)');26 tx.executeSql('CREATE TABLE IF NOT EXISTS nearByHistory( id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, type TEXT UNIQUE, clause TEXT )');
27 tx.executeSql('CREATE TABLE IF NOT EXISTS favHistory(id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, key TEXT UNIQUE, lat TEXT, lng TEXT)');27 tx.executeSql('CREATE TABLE IF NOT EXISTS favHistory( id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, key TEXT UNIQUE, lat TEXT, lng TEXT )');
28 tx.executeSql('CREATE TABLE IF NOT EXISTS searchHistory(id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, key TEXT UNIQUE, lat TEXT, lng TEXT)');28 tx.executeSql('CREATE TABLE IF NOT EXISTS searchHistory( id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, key TEXT UNIQUE, lat TEXT, lng TEXT )');
29 tx.executeSql('CREATE TABLE IF NOT EXISTS Car_poiQuickAccess( type TEXT UNIQUE, clause TEXT, distance TEXT )');
30 tx.executeSql('CREATE TABLE IF NOT EXISTS Bike_poiQuickAccess( type TEXT UNIQUE, clause TEXT, distance TEXT )');
31 tx.executeSql('CREATE TABLE IF NOT EXISTS Walk_poiQuickAccess( type TEXT UNIQUE, clause TEXT, distance TEXT )');
29 });32 });
30 }33 }
31}34}
@@ -77,7 +80,7 @@
77 openDB();80 openDB();
78 db.transaction( function(tx){81 db.transaction( function(tx){
79 tx.executeSql('INSERT OR REPLACE INTO favHistory(key, lat, lng) VALUES(?,?,?)', [key, parseFloat(lat).toFixed(7).toString(), parseFloat(lng).toFixed(7).toString()]);82 tx.executeSql('INSERT OR REPLACE INTO favHistory(key, lat, lng) VALUES(?,?,?)', [key, parseFloat(lat).toFixed(7).toString(), parseFloat(lng).toFixed(7).toString()]);
80 tx.executeSql('DELETE FROM favHistory WHERE id IN (SELECT id FROM favHistory ORDER BY id DESC LIMIT -1 OFFSET 3)'); // Keep last 383 tx.executeSql('DELETE FROM favHistory WHERE id IN (SELECT id FROM favHistory ORDER BY id DESC LIMIT -1 OFFSET 3)'); // Keep last 3
81 });84 });
82}85}
8386
@@ -91,6 +94,7 @@
91}94}
9295
93function removeHistoryFavorite(key) {96function removeHistoryFavorite(key) {
97
94 openDB();98 openDB();
95 db.transaction( function(tx){99 db.transaction( function(tx){
96 tx.executeSql('DELETE FROM favHistory WHERE key=?;', [key]);100 tx.executeSql('DELETE FROM favHistory WHERE key=?;', [key]);
@@ -148,6 +152,39 @@
148 });152 });
149}153}
150154
155// QuickAccess Storage
156function saveToQuickAccessItem(mode, type, clause, distance) {
157 openDB();
158 db.transaction( function(tx){
159 tx.executeSql('INSERT OR REPLACE INTO ' + mode +'_poiQuickAccess(type, clause, distance) VALUES(?,?,?)', [type, clause, distance]);
160 });
161}
162
163function getQuickAccessItems(mode) {
164 var res;
165 openDB();
166 db.transaction( function(tx) {
167 res = tx.executeSql('SELECT * FROM ' + mode +'_poiQuickAccess', []);
168 });
169 return res;
170}
171
172function countQuickAccessItems(mode) {
173 var res;
174 openDB();
175 db.transaction( function(tx) {
176 res = tx.executeSql('SELECT COUNT(*) AS count FROM ' + mode +'_poiQuickAccess', []);
177 });
178 return res;
179}
180
181function removeQuickAccessItem(mode, key) {
182 openDB();
183 db.transaction( function(tx){
184 tx.executeSql('DELETE FROM ' + mode +'_poiQuickAccess WHERE type=?;', [key]);
185 });
186}
187
151// delete historytables188// delete historytables
152function dropHistoryTables() {189function dropHistoryTables() {
153 openDB();190 openDB();

Subscribers

People subscribed via source and target branches