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
1=== modified file 'nav/class/UI.js'
2--- nav/class/UI.js 2016-04-22 18:37:23 +0000
3+++ nav/class/UI.js 2016-05-22 10:44:41 +0000
4@@ -483,33 +483,7 @@
5 }
6
7 UI.prototype.KO_API_radars = function() {
8- $('#error_get_radars').show();
9- this.error_API_radars();
10- $('#error_get_radars').delay(8000).fadeOut('slow');
11-}
12-
13-UI.prototype.error_API_radars = function() {
14- if (!$('#panel_msg').is(":visible") && !$('#panel_summary').is(":visible") && !$('#panel_review_btns').is(":visible")) {
15- $('#error_get_radars').hide();
16- return;
17- }
18-
19- if ($('#error_get_radars').is(":visible")) {
20- var aux_height = 0;
21- if ($('#panel_review_btns').is(':visible'))
22- aux_height = aux_height + $('#panel_review_btns').height();
23- if ($('#panel_review_summary').is(':visible'))
24- aux_height = aux_height + $('#panel_review_summary').height();
25- if ($('#panel_summary').is(':visible'))
26- aux_height = aux_height + $('#panel_summary').height();
27- if ($('#panel_txt_ind').is(':visible'))
28- aux_height = aux_height + $('#panel_txt_ind').height();
29- if ($('#panel_msg').is(':visible'))
30- aux_height = aux_height + $('#panel_msg').height();
31-
32- $('#error_get_radars').css({bottom: aux_height});
33- $('.ol-scale-line').css({top: (window.innerHeight - aux_height - 22), bottom: 'auto'});
34- }
35+ qml_show_notification('warning', 'speed_camera_error')
36 }
37
38 UI.prototype.map_height = function() {
39@@ -634,8 +608,7 @@
40 this.markers(gps_data['start_lat'], gps_data['start_lng'], gps_data['end_lat'], gps_data['end_lng']);
41
42 this.panels(route_indicator);
43- this.error_API_radars();
44-
45+
46 this.scale_line();
47
48 this.pos(gps_data['now_lat'], gps_data['now_lng'], gps_data['accu']);
49
50=== modified file 'nav/css/unav.css'
51--- nav/css/unav.css 2016-04-24 16:11:11 +0000
52+++ nav/css/unav.css 2016-05-22 10:44:41 +0000
53@@ -30,7 +30,7 @@
54 #panel_review_btns {
55 bottom:25px;
56 }
57-#panel_summary, #panel_review_summary, #error_get_radars {
58+#panel_summary, #panel_review_summary {
59 position:absolute;
60 bottom:0px;
61 width:100%;
62@@ -148,10 +148,3 @@
63 font-family:Ubuntu, Arial, Helvetica, sans-serif;font-size:16px;border-style:solid;
64 text-align:center;
65 }
66-
67-#error_get_radars {
68- color: #ffffff;
69- height:20px;
70- background: #ed3146;
71- z-index: 3;
72-}
73
74=== added file 'nav/img/header/poiConfig.svg'
75--- nav/img/header/poiConfig.svg 1970-01-01 00:00:00 +0000
76+++ nav/img/header/poiConfig.svg 2016-05-22 10:44:41 +0000
77@@ -0,0 +1,207 @@
78+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
79+<!-- Created with Inkscape (http://www.inkscape.org/) -->
80+
81+<svg
82+ xmlns:dc="http://purl.org/dc/elements/1.1/"
83+ xmlns:cc="http://creativecommons.org/ns#"
84+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
85+ xmlns:svg="http://www.w3.org/2000/svg"
86+ xmlns="http://www.w3.org/2000/svg"
87+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
88+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
89+ width="96"
90+ height="96"
91+ id="svg4874"
92+ version="1.1"
93+ inkscape:version="0.91 r13725"
94+ viewBox="0 0 96 96.000001"
95+ sodipodi:docname="poiConfig.svg">
96+ <defs
97+ id="defs4876" />
98+ <sodipodi:namedview
99+ id="base"
100+ pagecolor="#ffffff"
101+ bordercolor="#666666"
102+ borderopacity="1.0"
103+ inkscape:pageopacity="0.0"
104+ inkscape:pageshadow="2"
105+ inkscape:zoom="5.7646076"
106+ inkscape:cx="82.687528"
107+ inkscape:cy="35.845324"
108+ inkscape:document-units="px"
109+ inkscape:current-layer="g4780"
110+ showgrid="false"
111+ showborder="true"
112+ fit-margin-top="0"
113+ fit-margin-left="0"
114+ fit-margin-right="0"
115+ fit-margin-bottom="0"
116+ inkscape:snap-bbox="true"
117+ inkscape:bbox-paths="true"
118+ inkscape:bbox-nodes="true"
119+ inkscape:snap-bbox-edge-midpoints="true"
120+ inkscape:snap-bbox-midpoints="true"
121+ inkscape:object-paths="true"
122+ inkscape:snap-intersection-paths="true"
123+ inkscape:object-nodes="true"
124+ inkscape:snap-smooth-nodes="true"
125+ inkscape:snap-midpoints="true"
126+ inkscape:snap-object-midpoints="true"
127+ inkscape:snap-center="true"
128+ showguides="false"
129+ inkscape:guide-bbox="true"
130+ inkscape:window-width="1680"
131+ inkscape:window-height="974"
132+ inkscape:window-x="0"
133+ inkscape:window-y="24"
134+ inkscape:window-maximized="1">
135+ <inkscape:grid
136+ type="xygrid"
137+ id="grid5451"
138+ empspacing="8" />
139+ <sodipodi:guide
140+ orientation="1,0"
141+ position="8,-8.0000001"
142+ id="guide4063" />
143+ <sodipodi:guide
144+ orientation="1,0"
145+ position="4,-8.0000001"
146+ id="guide4065" />
147+ <sodipodi:guide
148+ orientation="0,1"
149+ position="-8,88.000001"
150+ id="guide4067" />
151+ <sodipodi:guide
152+ orientation="0,1"
153+ position="-8,92.000001"
154+ id="guide4069" />
155+ <sodipodi:guide
156+ orientation="0,1"
157+ position="104,4"
158+ id="guide4071" />
159+ <sodipodi:guide
160+ orientation="0,1"
161+ position="-5,8.0000001"
162+ id="guide4073" />
163+ <sodipodi:guide
164+ orientation="1,0"
165+ position="92,-8.0000001"
166+ id="guide4075" />
167+ <sodipodi:guide
168+ orientation="1,0"
169+ position="88,-8.0000001"
170+ id="guide4077" />
171+ <sodipodi:guide
172+ orientation="0,1"
173+ position="-8,84.000001"
174+ id="guide4074" />
175+ <sodipodi:guide
176+ orientation="1,0"
177+ position="12,-8.0000001"
178+ id="guide4076" />
179+ <sodipodi:guide
180+ orientation="0,1"
181+ position="-5,12"
182+ id="guide4078" />
183+ <sodipodi:guide
184+ orientation="1,0"
185+ position="84,-9.0000001"
186+ id="guide4080" />
187+ <sodipodi:guide
188+ position="48,-8.0000001"
189+ orientation="1,0"
190+ id="guide4170" />
191+ <sodipodi:guide
192+ position="-8,48"
193+ orientation="0,1"
194+ id="guide4172" />
195+ </sodipodi:namedview>
196+ <metadata
197+ id="metadata4879">
198+ <rdf:RDF>
199+ <cc:Work
200+ rdf:about="">
201+ <dc:format>image/svg+xml</dc:format>
202+ <dc:type
203+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
204+ <dc:title />
205+ </cc:Work>
206+ </rdf:RDF>
207+ </metadata>
208+ <g
209+ inkscape:label="Layer 1"
210+ inkscape:groupmode="layer"
211+ id="layer1"
212+ transform="translate(67.857146,-78.50504)">
213+ <g
214+ transform="matrix(0,-1,-1,0,373.50506,516.50504)"
215+ id="g4845"
216+ style="display:inline">
217+ <g
218+ inkscape:export-ydpi="90"
219+ inkscape:export-xdpi="90"
220+ inkscape:export-filename="next01.png"
221+ transform="matrix(-0.9996045,0,0,1,575.94296,-611.00001)"
222+ id="g4778"
223+ inkscape:label="Layer 1">
224+ <g
225+ transform="matrix(-1,0,0,1,575.99999,611)"
226+ id="g4780"
227+ style="display:inline">
228+ <path
229+ 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"
230+ 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"
231+ id="path4176"
232+ inkscape:connector-curvature="0" />
233+ <rect
234+ style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:none;stroke:none;stroke-width:4;marker:none;enable-background:accumulate"
235+ id="rect4782"
236+ width="96.037987"
237+ height="96"
238+ x="-438.00244"
239+ y="345.36221"
240+ transform="scale(-1,1)" />
241+ <rect
242+ style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:none;stroke:none;stroke-width:4;marker:none;enable-background:accumulate"
243+ id="rect4782-9"
244+ width="47.169224"
245+ height="47.150566"
246+ x="-393.25696"
247+ y="354.67883"
248+ transform="scale(-1,1)" />
249+ <path
250+ inkscape:connector-curvature="0"
251+ 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"
252+ 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"
253+ id="path4157" />
254+ <path
255+ inkscape:connector-curvature="0"
256+ 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"
257+ 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"
258+ id="path4344" />
259+ <path
260+ inkscape:connector-curvature="0"
261+ 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"
262+ 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"
263+ id="rect3972-1" />
264+ <rect
265+ 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"
266+ id="rect3974-0"
267+ width="15.71686"
268+ height="1.9653834"
269+ x="-374.32489"
270+ y="-357.88004"
271+ transform="matrix(0,-1,-1,0,0,0)" />
272+ <rect
273+ 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"
274+ id="rect3976-5"
275+ width="21.610626"
276+ height="1.9653106"
277+ x="-380.21872"
278+ y="-351.98389"
279+ transform="matrix(0,-1,-1,0,0,0)" />
280+ </g>
281+ </g>
282+ </g>
283+ </g>
284+</svg>
285
286=== modified file 'nav/img/mode/bike.svg'
287--- nav/img/mode/bike.svg 2016-03-26 18:53:17 +0000
288+++ nav/img/mode/bike.svg 2016-05-22 10:44:41 +0000
289@@ -10,36 +10,41 @@
290 version="1.0"
291 x="0px"
292 y="0px"
293- viewBox="0 0 100 61.284"
294+ viewBox="0 0 96 95.999999"
295 enable-background="new 0 0 100 61.284"
296 xml:space="preserve"
297 id="svg2"
298 inkscape:version="0.91 r13725"
299- sodipodi:docname="noun_536.svg"><metadata
300+ sodipodi:docname="bike.svg"
301+ width="96"
302+ height="96"
303+ shape-rendering="crispEdges"><metadata
304 id="metadata10"><rdf:RDF><cc:Work
305 rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
306- rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
307+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
308 id="defs8" /><sodipodi:namedview
309- pagecolor="#ffffff"
310- bordercolor="#666666"
311+ pagecolor="#c8c8c8"
312+ bordercolor="#818181"
313 borderopacity="1"
314 objecttolerance="10"
315 gridtolerance="10"
316 guidetolerance="10"
317 inkscape:pageopacity="0"
318 inkscape:pageshadow="2"
319- inkscape:window-width="1280"
320- inkscape:window-height="854"
321+ inkscape:window-width="1366"
322+ inkscape:window-height="744"
323 id="namedview6"
324 showgrid="false"
325- inkscape:zoom="3.8509235"
326- inkscape:cx="17.020898"
327- inkscape:cy="30.642"
328+ inkscape:zoom="2.7230142"
329+ inkscape:cx="-6.8710741"
330+ inkscape:cy="30.019466"
331 inkscape:window-x="0"
332- inkscape:window-y="24"
333+ inkscape:window-y="0"
334 inkscape:window-maximized="1"
335- inkscape:current-layer="svg2" /><path
336- 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"
337+ inkscape:current-layer="svg2"
338+ showborder="true"
339+ inkscape:showpageshadow="false" /><path
340+ 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"
341 id="path4"
342 style="fill:#ffffff"
343 inkscape:connector-curvature="0" /></svg>
344\ No newline at end of file
345
346=== modified file 'nav/img/mode/car.svg'
347--- nav/img/mode/car.svg 2016-03-26 18:53:17 +0000
348+++ nav/img/mode/car.svg 2016-05-22 10:44:41 +0000
349@@ -11,17 +11,19 @@
350 version="1.1"
351 x="0px"
352 y="0px"
353- viewBox="0 0 100 125"
354+ viewBox="0 0 96 96"
355 enable-background="new 0 0 100 100"
356 xml:space="preserve"
357 id="svg2"
358 inkscape:version="0.91 r13725"
359- sodipodi:docname="noun_152445_cc.svg"><metadata
360+ sodipodi:docname="car.svg"
361+ width="96"
362+ height="96"><metadata
363 id="metadata18"><rdf:RDF><cc:Work
364 rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
365- rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
366+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
367 id="defs16" /><sodipodi:namedview
368- pagecolor="#ffffff"
369+ pagecolor="#acacac"
370 bordercolor="#666666"
371 borderopacity="1"
372 objecttolerance="10"
373@@ -29,19 +31,19 @@
374 guidetolerance="10"
375 inkscape:pageopacity="0"
376 inkscape:pageshadow="2"
377- inkscape:window-width="1280"
378- inkscape:window-height="854"
379+ inkscape:window-width="1366"
380+ inkscape:window-height="744"
381 id="namedview14"
382 showgrid="false"
383 inkscape:zoom="1.888"
384 inkscape:cx="-17.266949"
385 inkscape:cy="62.5"
386 inkscape:window-x="0"
387- inkscape:window-y="24"
388+ inkscape:window-y="0"
389 inkscape:window-maximized="1"
390 inkscape:current-layer="svg2" /><switch
391 id="switch4"
392- transform="matrix(1.0943644,0,0,1.0943644,-4.9408658,7.8912164)"><foreignObject
393+ transform="matrix(1.0244202,0,0,1.0244202,-3.4294271,11.070804)"><foreignObject
394 requiredExtensions="http://ns.adobe.com/AdobeIllustrator/10.0/"
395 x="0"
396 y="0"
397
398=== modified file 'nav/img/mode/walk.svg'
399--- nav/img/mode/walk.svg 2016-03-26 18:53:17 +0000
400+++ nav/img/mode/walk.svg 2016-05-22 10:44:41 +0000
401@@ -10,17 +10,19 @@
402 version="1.0"
403 x="0px"
404 y="0px"
405- viewBox="0 0 55.74 100"
406+ viewBox="0 0 95.999997 96"
407 enable-background="new 0 0 55.74 100"
408 xml:space="preserve"
409 id="svg2"
410 inkscape:version="0.91 r13725"
411- sodipodi:docname="walk.svg"><metadata
412+ sodipodi:docname="walk.svg"
413+ width="96"
414+ height="96"><metadata
415 id="metadata12"><rdf:RDF><cc:Work
416 rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
417- rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
418+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title /></cc:Work></rdf:RDF></metadata><defs
419 id="defs10" /><sodipodi:namedview
420- pagecolor="#ffffff"
421+ pagecolor="#858585"
422 bordercolor="#666666"
423 borderopacity="1"
424 objecttolerance="10"
425@@ -28,22 +30,22 @@
426 guidetolerance="10"
427 inkscape:pageopacity="0"
428 inkscape:pageshadow="2"
429- inkscape:window-width="1615"
430- inkscape:window-height="1026"
431+ inkscape:window-width="1366"
432+ inkscape:window-height="744"
433 id="namedview8"
434 showgrid="false"
435 inkscape:zoom="2.36"
436 inkscape:cx="-89.079151"
437 inkscape:cy="50"
438- inkscape:window-x="65"
439- inkscape:window-y="24"
440+ inkscape:window-x="0"
441+ inkscape:window-y="0"
442 inkscape:window-maximized="1"
443 inkscape:current-layer="svg2" /><path
444- 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"
445+ 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"
446 id="path4"
447 style="fill:#ffffff"
448 inkscape:connector-curvature="0" /><path
449- 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"
450+ 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"
451 id="path6"
452 style="fill:#ffffff"
453 inkscape:connector-curvature="0" /></svg>
454\ No newline at end of file
455
456=== modified file 'nav/index.html'
457--- nav/index.html 2016-04-24 16:15:59 +0000
458+++ nav/index.html 2016-05-22 10:44:41 +0000
459@@ -103,11 +103,6 @@
460 <span id="txt_mapspeed"></span>
461 </div>
462
463- <!-- Error getting radar -->
464- <div id="error_get_radars" style="display:none;">
465- <span data-localize="Error getting speed cameras">Error getting speed cameras</span>
466- </div>
467-
468 <!-- Warning for long routes -->
469 <div id="popup_longroute" style="display:none;" data-role="dialog">
470 <section>
471@@ -524,11 +519,13 @@
472
473 function qml_save_pos() {
474 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)
475- return;
476-
477+ return;
478 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();
479 }
480
481+ function qml_show_notification(mode, message) {
482+ window.location = 'http://show_notification?' + mode.toString() + '/' + message.toString();
483+ }
484
485 // QML events returning
486 function calc2coord(lat, lng) {
487
488=== modified file 'qml/Main.qml'
489--- qml/Main.qml 2016-04-25 19:52:54 +0000
490+++ qml/Main.qml 2016-05-22 10:44:41 +0000
491@@ -150,9 +150,6 @@
492 property bool favPopup: false
493 property bool onLoadingExecuted: false
494
495- onCurrentLatChanged: console.log("CURRENT Lat changed: " + mainPageStack.currentLat)
496-
497-
498 property string usContext: "messaging://"
499 // Workaround: as long as map keeps a webcontainer this function handles js events to the webview.
500 function executeJavaScript(code) {
501@@ -320,7 +317,7 @@
502 goThereActionPopover.phone = params[5];
503
504 if (params[6] !== "none")
505- goThereActionPopover.poiName = params[6].replace(/¿¿¿/g, "\/");
506+ goThereActionPopover.poiName = decodeURIComponent(params[6]);
507
508 mainPageStack.favPopup = false;
509 goThereActionPopover.show();
510@@ -366,8 +363,23 @@
511 navApp.settings.prevLng = params[1];
512 navApp.settings.prevZoom = params[2];
513 break;
514+
515+ case "http://show_notification/":
516+ if (params[1] === "speed_camera_error") {
517+ notifiactionBar.text = i18n.tr("Error getting speed cameras!");
518+ }
519+ switch (params[0]) {
520+ case "info":
521+ notifiactionBar.info();
522+ break;
523+ case "warning":
524+ notifiactionBar.warning();
525+ break;
526+ case "critical":
527+ notifiactionBar.critical();
528+ }
529+ notificationBarTimer.start();
530 }
531-
532 request.action = Oxide.NavigationRequest.ActionReject;
533 }
534
535@@ -507,6 +519,19 @@
536 }
537 }
538
539+ Timer {
540+ id: notificationBarTimer
541+ interval: 8000
542+ repeat: false
543+ onTriggered: {
544+ notifiactionBar.visible = false
545+ }
546+ }
547+
548+ NotificationBar {
549+ id: notifiactionBar
550+ }
551+
552 XmlListModel {
553 id: reverseXmlModel
554
555@@ -617,47 +642,56 @@
556
557 Component {
558 id: routeMenu
559- Item {
560- width: parent.width
561+ Column {
562 height: routePageGrid.height
563-
564+ spacing: 0
565 Component.onCompleted: {
566 mainPageStack.executeJavaScript("qml_set_route_status();")
567 }
568
569- CustomGridView {
570- id: routePageGrid
571-
572- ListModel {
573- id: routePageModel
574- Component.onCompleted: initialize()
575-
576- function initialize() {
577- routePageModel.append({mode: "DESTINATION", text: i18n.tr("NearBy Destination"), iconName: "location"})
578- routePageModel.append({mode: "CANCEL", text: i18n.tr("Cancel Route"), iconName: "dialog-error-symbolic"})
579- }
580- }
581-
582- itemWidth: units.gu(9)
583- model: routePageModel
584+ Row {
585+ id: gridRow
586+ spacing: units.gu(2)
587 anchors.horizontalCenter: parent.horizontalCenter
588
589- delegate: GridDelegate {
590- id: delegate
591-
592- width: units.gu(9)
593- title: model.text
594- icon.name: model.iconName
595-
596- onClicked: {
597- if (model.mode === "DESTINATION") {
598- mainPageStack.addPageToNextColumn(mainPageStack.primaryPage, Qt.resolvedUrl("PoiPage.qml"), {"lat": mainPageStack.endLat, "lng": mainPageStack.endLng})
599- } else if (model.mode === "CANCEL") {
600- mainPageStack.routeState = 'no';
601- mainPageStack.executeJavaScript("click_cancel_route();");
602- }
603- goThereActionPopover.showMenu = false
604- goThereActionPopover.hide()
605+ Loader {
606+ id: poiQuickAccessLoader
607+ sourceComponent: POIQuickAccessGridView {}
608+ }
609+
610+ CustomGridView {
611+ id: routePageGrid
612+
613+ ListModel {
614+ id: routePageModel
615+ Component.onCompleted: initialize()
616+
617+ function initialize() {
618+ routePageModel.append({mode: "DESTINATION", text: i18n.tr("NearBy Destination"), iconName: "location"})
619+ routePageModel.append({mode: "CANCEL", text: i18n.tr("Cancel Route"), iconName: "dialog-error-symbolic"})
620+ }
621+ }
622+
623+ itemWidth: units.gu(8)
624+ model: routePageModel
625+
626+ delegate: GridDelegate {
627+ id: delegate
628+
629+ width: units.gu(8)
630+ title: model.text
631+ icon.name: model.iconName
632+
633+ onClicked: {
634+ if (model.mode === "DESTINATION") {
635+ mainPageStack.addPageToNextColumn(mainPageStack.primaryPage, Qt.resolvedUrl("PoiPage.qml"), {"lat": mainPageStack.endLat, "lng": mainPageStack.endLng})
636+ } else if (model.mode === "CANCEL") {
637+ mainPageStack.routeState = 'no';
638+ mainPageStack.executeJavaScript("click_cancel_route();");
639+ }
640+ goThereActionPopover.showMenu = false
641+ goThereActionPopover.hide()
642+ }
643 }
644 }
645 }
646@@ -706,9 +740,9 @@
647 mainPageStack.favPopup = !mainPageStack.favPopup;
648 mainPageStack.showSideBar()
649 var incubator = mainPageStack.addPageToNextColumn(mainPageStack.primaryPage, Qt.resolvedUrl("SearchPage.qml"), {favLat: mainPageStack.clickedLat, favLng: mainPageStack.clickedLng, favName: ""});
650- if (incubator && incubator.status == Component.Loading) {
651+ if (incubator && incubator.status === Component.Loading) {
652 incubator.onStatusChanged = function(status) {
653- if (status == Component.Ready) {
654+ if (status === Component.Ready) {
655 incubator.object.addFavorite()
656 }
657 }
658
659=== modified file 'qml/PoiDetailsPage.qml'
660--- qml/PoiDetailsPage.qml 2016-04-28 16:07:19 +0000
661+++ qml/PoiDetailsPage.qml 2016-05-22 10:44:41 +0000
662@@ -52,7 +52,7 @@
663 XmlListModel {
664 id: poiDetailsModel
665
666- readonly property string baseUrl: "http://nominatim.openstreetmap.org/reverse?format=xml&addressdetails=1&email=costales.marcos@gmail.com&extratags=1"
667+ readonly property string baseUrl: "https://nominatim.openstreetmap.org/reverse?format=xml&addressdetails=1&email=costales.marcos@gmail.com&extratags=1"
668 readonly property string url: baseUrl + "&osm_type=" + osm_type + "&osm_id=" + osm_id
669
670 property string lat
671
672=== modified file 'qml/PoiListPage.qml'
673--- qml/PoiListPage.qml 2016-04-30 09:20:05 +0000
674+++ qml/PoiListPage.qml 2016-05-22 10:44:41 +0000
675@@ -160,7 +160,7 @@
676 if (status === XmlListModel.Loading) { statusLabel.text = i18n.tr("Searching…") }
677 }
678
679- readonly property string baseUrl: "http://nominatim.openstreetmap.org/search?format=xml&bounded=1&limit=50&email=costales.marcos@gmail.com&extratags=1"
680+ readonly property string baseUrl: "https://nominatim.openstreetmap.org/search?format=xml&bounded=1&limit=50&email=costales.marcos@gmail.com&extratags=1"
681 readonly property double geoDist: navApp.settings.unit === 0 ? 0.01 : 0.01 / 0.621371192
682 // geographic distance ~1.1km / ~1.1mi
683 // rough estimation only. Could be redefined.
684
685=== added file 'qml/PoiQuickAccessPage.qml'
686--- qml/PoiQuickAccessPage.qml 1970-01-01 00:00:00 +0000
687+++ qml/PoiQuickAccessPage.qml 2016-05-22 10:44:41 +0000
688@@ -0,0 +1,185 @@
689+/*
690+ * GPS Navigation http://launchpad.net/unav
691+ * Copyright (C) 2015-2016 Marcos Alvarez Costales https://launchpad.net/~costales
692+ * Copyright (C) 2015-2016 JkB https://launchpad.net/~joergberroth
693+ * Copyright (C) 2016 Nekhelesh Ramananthan http://launchpad.net/~nik90
694+ *
695+ * GPS Navigation is free software; you can redistribute it and/or modify
696+ * it under the terms of the GNU General Public License as published by
697+ * the Free Software Foundation; either version 3 of the License, or
698+ * (at your option) any later version.
699+ *
700+ * GPS Navigation is distributed in the hope that it will be useful,
701+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
702+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
703+ * GNU General Public License for more details.
704+ */
705+
706+import QtQuick 2.4
707+import Ubuntu.Components 1.3
708+import Ubuntu.Components.Popups 1.3
709+import QtQuick.XmlListModel 2.0
710+import QtQuick.LocalStorage 2.0
711+import "components"
712+import "js/PoiCategories.js" as Categories
713+import "js/db.js" as UnavDB
714+
715+Page {
716+ id: poiQuickAccessPage
717+
718+ property string unit: navApp.settings.unit === 0 ? "km" : "mi"
719+ property var factorList: ["1", "5", "15", "30", "50"]
720+
721+ readonly property int maxQuickAccessItems: 5
722+
723+ property string mode: "Car"
724+
725+ Component.onCompleted: {
726+ switch (navApp.settings.routingMode) {
727+ case 0:
728+ poiQuickAccessPage.mode = "Car";
729+ break;
730+ case 1:
731+ poiQuickAccessPage.mode = "Walk";
732+ break;
733+ case 2:
734+ poiQuickAccessPage.mode = "Bike";
735+ break;
736+ }
737+ categoryListModel.initialize()
738+ }
739+
740+ Component.onDestruction: {
741+ // Hide 2nd column when returning to the map to avoid an empty white column
742+ if (mainPageStack.columns === 1)
743+ mainPageStack.hideSideBar()
744+ }
745+
746+ header: UNavHeader {
747+ id: poiQuickAccessHeader
748+
749+ flickable: categoryList
750+
751+ title: i18n.tr("Quick Access: ") + i18n.tr(mode)
752+
753+ trailingActionBar {
754+ actions: [
755+ CloseHeaderAction {}
756+ ]
757+ }
758+
759+ extension: UNavPageSection {
760+ id: distanceSections
761+ anchors {
762+ left: parent.left
763+ bottom: parent.bottom
764+ }
765+
766+ model: [factorList[0]+unit, factorList[1]+unit, factorList[2]+unit, factorList[3]+unit, factorList[4]+unit]
767+ selectedIndex: 1
768+ }
769+ }
770+
771+ ListModel {
772+ id: categoryListModel
773+ property var indices: []
774+ function initialize() {
775+ categoryListModel.clear();
776+ categoryListModel.indices = [];
777+ var res = UnavDB.getQuickAccessItems(poiQuickAccessPage.mode);
778+ var len = res.rows.length;
779+ for ( var i = 0; i < len; ++i) {
780+ categoryListModel.indices.push( res.rows.item(i).type )
781+ }
782+ Categories.data.forEach( function(category) {
783+ categoryListModel.append(category);
784+ });
785+ categoryList.update()
786+ }
787+ }
788+
789+ SortFilterModel {
790+ id: sortedCategoryListModel
791+ model: categoryListModel
792+ filter.property: "label"
793+ filter.pattern: RegExp("", "gi")
794+ }
795+
796+ ListView {
797+ id: categoryList
798+
799+ model: sortedCategoryListModel
800+ anchors.fill: parent
801+ clip: true
802+
803+ section.property: "theme"
804+ section.criteria: ViewSection.FullString
805+ section.labelPositioning: ViewSection.CurrentLabelAtStart + ViewSection.InlineLabels
806+ section.delegate: Rectangle {
807+ width: parent.width
808+ height: sectionHeader.height
809+
810+ ListItemHeader {
811+ id: sectionHeader
812+ title: section
813+ }
814+ }
815+
816+ delegate: ListItem {
817+ id: poiItem
818+ divider.visible: true
819+ height: poiItemLayout.height
820+
821+ ListItemLayout {
822+ id: poiItemLayout
823+ title.text: label
824+
825+ Icon {
826+ source: Qt.resolvedUrl("../nav/img/poi/" + model.en_label + ".svg")
827+ height: units.gu(2.5)
828+ width: height
829+ SlotsLayout.position: SlotsLayout.Leading
830+ }
831+
832+ CheckBox {
833+ id: quickAccessCheckBox
834+ checked: categoryListModel.indices.indexOf(model.en_label) > -1
835+ SlotsLayout.position: SlotsLayout.Trailing
836+ onClicked: {
837+ var count = UnavDB.countQuickAccessItems(poiQuickAccessPage.mode).rows.item(0).count;
838+ if (!quickAccessCheckBox.checked) {
839+ UnavDB.removeQuickAccessItem( poiQuickAccessPage.mode, model.en_label )
840+ } else if (quickAccessCheckBox.checked && count >= poiQuickAccessPage.maxQuickAccessItems ){
841+ quickAccessCheckBox.checked = false;
842+ PopupUtils.open(maxSelectedDialogComponent);
843+ } else if (quickAccessCheckBox.checked && count < poiQuickAccessPage.maxQuickAccessItems ){
844+ UnavDB.saveToQuickAccessItem(poiQuickAccessPage.mode, model.en_label, model.clause, factorList[header.extension.selectedIndex])
845+ }
846+ }
847+ }
848+ }
849+ }
850+ }
851+
852+ Scrollbar {
853+ flickableItem: categoryList
854+ align: Qt.AlignTrailing
855+ }
856+
857+ Component {
858+ id: maxSelectedDialogComponent
859+ Dialog {
860+ id: maxSelectedDialog
861+ title: i18n.tr("Selection")
862+ //TRANSLATORS: argument is a number > 1.
863+ text: i18n.tr("Max. %1 POIs can be selected.").arg(poiQuickAccessPage.maxQuickAccessItems)
864+
865+ Button {
866+ text: i18n.tr("OK")
867+ color: UbuntuColors.orange
868+ onClicked: PopupUtils.close(maxSelectedDialog);
869+ }
870+ }
871+ }
872+}
873+
874
875=== added file 'qml/components/NotificationBar.qml'
876--- qml/components/NotificationBar.qml 1970-01-01 00:00:00 +0000
877+++ qml/components/NotificationBar.qml 2016-05-22 10:44:41 +0000
878@@ -0,0 +1,88 @@
879+/*
880+ * GPS Navigation http://launchpad.net/unav
881+ * Copyright (C) 2015-2016 JkB https://launchpad.net/~joergberroth
882+ * Copyright (C) 2015-2016 Marcos Alvarez Costales https://launchpad.net/~costales
883+ *
884+ * GPS Navigation is free software; you can redistribute it and/or modify
885+ * it under the terms of the GNU General Public License as published by
886+ * the Free Software Foundation; either version 3 of the License, or
887+ * (at your option) any later version.
888+ *
889+ * GPS Navigation is distributed in the hope that it will be useful,
890+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
891+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
892+ * GNU General Public License for more details.
893+ */
894+
895+import QtQuick 2.4
896+import Ubuntu.Components 1.3
897+
898+Rectangle {
899+ id: notificationRectangle
900+
901+ property alias text: notificationLabel.text
902+
903+ signal info()
904+ signal warning()
905+ signal critical()
906+
907+ onInfo: {
908+ notificationLabel.color = UbuntuColors.slate
909+ notificationRectangle.color = "#FFFFFF"
910+ notificationRectangle.visible = true;
911+ notificationIcon.name = ""
912+ notificationLabel.fontSize = "medium"
913+ notificationRectangle.height = notificationLabel.height + units.gu(1)
914+ }
915+ onWarning: {
916+ notificationLabel.color = "#FFFFFF"
917+ notificationRectangle.color = UbuntuColors.orange;
918+ notificationRectangle.visible = true;
919+ notificationLabel.fontSize = "large"
920+ notificationIcon.name = "dialog-warning-symbolic"
921+ notificationRectangle.height = notificationLabel.height + units.gu(4)
922+ }
923+ onCritical: {
924+ notificationLabel.color = "#FFFFFF"
925+ notificationRectangle.color = UbuntuColors.red
926+ notificationRectangle.visible = true;
927+ notificationLabel.fontSize = "large"
928+ notificationIcon.name = "dialog-error-symbolic"
929+ notificationRectangle.height = notificationLabel.height + units.gu(4)
930+ }
931+
932+ width: parent.width
933+ visible: false
934+
935+ anchors {
936+ top: goThereActionPopover.isShown ? goThereActionPopover.bottom : navigationPage.header.bottom
937+ }
938+
939+ Icon {
940+ id: notificationIcon
941+ width: units.gu(3.5)
942+ height: width
943+ anchors {
944+ verticalCenter: parent.verticalCenter
945+ left: parent.left
946+ leftMargin: units.gu(2)
947+ }
948+ visible: name !== ""
949+ color: "#FFFFFF"
950+
951+ }
952+
953+ Label {
954+ id: notificationLabel
955+ anchors {
956+ left: notificationIcon.visible ? notificationIcon.right : parent.left
957+ margins: units.gu(1)
958+ right: parent.right
959+ verticalCenter: parent.verticalCenter
960+ }
961+ horizontalAlignment: Text.AlignHCenter
962+ maximumLineCount: 3
963+ wrapMode: Text.WordWrap
964+ elide: Text.ElideRight
965+ }
966+}
967
968=== added file 'qml/components/POIQuickAccessGridView.qml'
969--- qml/components/POIQuickAccessGridView.qml 1970-01-01 00:00:00 +0000
970+++ qml/components/POIQuickAccessGridView.qml 2016-05-22 10:44:41 +0000
971@@ -0,0 +1,184 @@
972+/*
973+ * GPS Navigation http://launchpad.net/unav
974+ * Copyright (C) 2015-2016 JkB https://launchpad.net/~joergberroth
975+ * Copyright (C) 2015-2016 Marcos Alvarez Costales https://launchpad.net/~costales
976+ *
977+ * GPS Navigation is free software; you can redistribute it and/or modify
978+ * it under the terms of the GNU General Public License as published by
979+ * the Free Software Foundation; either version 3 of the License, or
980+ * (at your option) any later version.
981+ *
982+ * GPS Navigation is distributed in the hope that it will be useful,
983+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
984+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
985+ * GNU General Public License for more details.
986+ */
987+
988+import QtQuick 2.4
989+import Ubuntu.Components 1.3
990+import QtQuick.LocalStorage 2.0
991+import "../js/db.js" as UnavDB
992+import QtQuick.XmlListModel 2.0
993+
994+Grid {
995+ id: gridView
996+
997+ readonly property int maxQuickAccessItems: 5
998+
999+ property int itemWidth: units.gu(3.5)
1000+
1001+ rowSpacing: units.gu(1)
1002+ columnSpacing: units.gu(2)
1003+ width: (columns * itemWidth) + columnSpacing * (columns - 1)
1004+
1005+ columns: 2
1006+ rows: 2
1007+ layoutDirection: Qt.RightToLeft
1008+
1009+ ListModel {
1010+ id: quickAccessModel
1011+ function initialize() {
1012+ quickAccessModel.clear();
1013+ var mode;
1014+ if (navApp.settings.routingMode === 0) {mode = "Car"}
1015+ if (navApp.settings.routingMode === 1) {mode = "Walk"}
1016+ if (navApp.settings.routingMode === 2) {mode = "Bike"}
1017+ var res = UnavDB.getQuickAccessItems( mode )
1018+ var len = res.rows.length;
1019+ for ( var i = 0; i < (len <= maxQuickAccessItems ? len : maxQuickAccessItems) ; ++i) {
1020+ quickAccessModel.append(
1021+ {
1022+ label: i18n.tr(res.rows.item(i).type),
1023+ en_label: res.rows.item(i).type,
1024+ clause: res.rows.item(i).clause,
1025+ distance: res.rows.item(i).distance
1026+ }
1027+ );
1028+ }
1029+ quickAccessModel.insert(0,{label:"add"});
1030+ var gridcolumns = Math.ceil(quickAccessModel.count/2);
1031+ gridView.columns = gridcolumns > 2 ? gridcolumns : 2
1032+ }
1033+ Component.onCompleted: initialize()
1034+ }
1035+
1036+ XmlListModel {
1037+ id: poiXmlModel
1038+ property string distance
1039+ property string clause
1040+ function allPOI() {
1041+ var allPOI = [];
1042+ for (var i = 0; i < poiXmlModel.count; i++) {
1043+ allPOI.push({
1044+ title: poiXmlModel.get(i).name.split(',')[0],
1045+ lat: parseFloat(poiXmlModel.get(i).lat),
1046+ lng: parseFloat(poiXmlModel.get(i).lng),
1047+ osm_id: poiXmlModel.get(i).osm_id,
1048+ osm_type: poiXmlModel.get(i).osm_type.charAt(0).toUpperCase(),
1049+ phone: poiXmlModel.get(i).phone,
1050+ distance: poiXmlModel.distance
1051+ });
1052+ }
1053+ return allPOI;
1054+ }
1055+
1056+ onStatusChanged: {
1057+
1058+ if (status === XmlListModel.Error) {
1059+ console.log(errorString());
1060+ source = "";
1061+ notificationBarTimer.start();
1062+ notifiactionBar.text = i18n.tr("Error getting results. Please, check your data connection.");
1063+ notifiactionBar.critical();
1064+ }
1065+ if (status === XmlListModel.Ready && count === 0) {
1066+ notificationBarTimer.start();
1067+ notifiactionBar.text = i18n.tr("Sorry, no results found nearby.");
1068+ notifiactionBar.info();
1069+ }
1070+ if (status === XmlListModel.Ready && count >> 0) {
1071+ notifiactionBar.visible = false;
1072+ mainPageStack.executeJavaScript("ui.markers_POI_set(" + JSON.stringify(poiXmlModel.allPOI()) + ")");
1073+ mainPageStack.center_onpos = 1;
1074+ goThereActionPopover.hide();
1075+ }
1076+ }
1077+
1078+ readonly property string baseUrl: "https://nominatim.openstreetmap.org/search?format=xml&bounded=1&limit=50&email=costales.marcos@gmail.com&extratags=1"
1079+ readonly property double geoDist: navApp.settings.unit === 0 ? 0.01 : 0.01 / 0.621371192
1080+ // geographic distance ~1.1km / ~1.1mi
1081+ // rough estimation only. Could be redefined.
1082+
1083+ function search() {
1084+ // Boxed area in which to search for PoI
1085+ var bbox = ( Number(mainPageStack.currentLng) - geoDist*distance).toString() + ","
1086+ + ( Number(mainPageStack.currentLat) - geoDist*distance).toString() + ","
1087+ + ( Number(mainPageStack.currentLng) + geoDist*distance).toString() + ","
1088+ + ( Number(mainPageStack.currentLat) + geoDist*distance).toString();
1089+ source = (baseUrl + "&q=" + clause + "&viewbox=" + bbox);
1090+ }
1091+ function clear() {
1092+ source = "";
1093+ }
1094+
1095+ source: ""
1096+ query: "/searchresults/place"
1097+
1098+ XmlRole { name: "osm_type"; query: "@osm_type/string()"; }
1099+ XmlRole { name: "osm_id"; query: "@osm_id/string()"; }
1100+ XmlRole { name: "name"; query: "@display_name/string()"; }
1101+ XmlRole { name: "phone"; query: "extratags/tag[@key='phone']/@value/string()"; }
1102+ XmlRole { name: "lat"; query: "@lat/string()"; }
1103+ XmlRole { name: "lng"; query: "@lon/string()"; }
1104+ }
1105+
1106+ Repeater {
1107+
1108+ model: quickAccessModel
1109+
1110+ delegate: AbstractButton {
1111+ id: button
1112+ width: units.gu(4)
1113+ height: width
1114+ opacity: button.pressed ? 0.5 : (enabled ? 1 : 0.2)
1115+
1116+ Behavior on opacity {
1117+ UbuntuNumberAnimation { }
1118+ }
1119+
1120+ UbuntuShape {
1121+ id: shape
1122+
1123+ aspect: UbuntuShape.Flat
1124+ anchors.fill: parent
1125+ radius: "medium"
1126+ }
1127+
1128+ Icon {
1129+ source: model.label !== "add" ? Qt.resolvedUrl("../../nav/img/poi/" + model.en_label + ".svg"): "../../nav/img/header/poiConfig.svg"
1130+ opacity: 0.6 //model.label === "add" ? 1 :0.6
1131+ width: units.gu(3.25)
1132+ enabled: navigationPage.buttonsEnabled
1133+
1134+ anchors.centerIn: parent
1135+ color: UbuntuColors.slate
1136+ }
1137+ onClicked: {
1138+ if (model.label === "add") {
1139+ goThereActionPopover.hide()
1140+ mainPageStack.showSideBar()
1141+ mainPageStack.addPageToNextColumn(mainPageStack.primaryPage, Qt.resolvedUrl("../PoiQuickAccessPage.qml"))
1142+ } else {
1143+ poiXmlModel.clear()
1144+ notifiactionBar.text = i18n.tr("Searching…")
1145+ notifiactionBar.info()
1146+ poiXmlModel.distance = model.distance;
1147+ poiXmlModel.clause = model.clause;
1148+ poiXmlModel.search();
1149+ mainPageStack.executeJavaScript("ui.markers_POI_clear()")
1150+ }
1151+ }
1152+ }
1153+ }
1154+}
1155+
1156
1157=== modified file 'qml/js/db.js'
1158--- qml/js/db.js 2016-04-17 14:08:53 +0000
1159+++ qml/js/db.js 2016-05-22 10:44:41 +0000
1160@@ -20,12 +20,15 @@
1161
1162 function openDB() {
1163 if (db === null) {
1164- db = LocalStorage.openDatabaseSync("unav_db", "0.1", "Favorites and history", 1000);
1165- db.transaction(function(tx){
1166- tx.executeSql('CREATE TABLE IF NOT EXISTS favorites(key TEXT UNIQUE, lat TEXT, lng TEXT)');
1167- tx.executeSql('CREATE TABLE IF NOT EXISTS nearByHistory(id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, type TEXT UNIQUE, clause TEXT)');
1168- tx.executeSql('CREATE TABLE IF NOT EXISTS favHistory(id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, key TEXT UNIQUE, lat TEXT, lng TEXT)');
1169- tx.executeSql('CREATE TABLE IF NOT EXISTS searchHistory(id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, key TEXT UNIQUE, lat TEXT, lng TEXT)');
1170+ db = LocalStorage.openDatabaseSync("unav_db", "0.1", "Favorites and history", 1000);
1171+ db.transaction(function(tx){
1172+ tx.executeSql('CREATE TABLE IF NOT EXISTS favorites( key TEXT UNIQUE, lat TEXT, lng TEXT)');
1173+ tx.executeSql('CREATE TABLE IF NOT EXISTS nearByHistory( id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, type TEXT UNIQUE, clause TEXT )');
1174+ tx.executeSql('CREATE TABLE IF NOT EXISTS favHistory( id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, key TEXT UNIQUE, lat TEXT, lng TEXT )');
1175+ tx.executeSql('CREATE TABLE IF NOT EXISTS searchHistory( id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, key TEXT UNIQUE, lat TEXT, lng TEXT )');
1176+ tx.executeSql('CREATE TABLE IF NOT EXISTS Car_poiQuickAccess( type TEXT UNIQUE, clause TEXT, distance TEXT )');
1177+ tx.executeSql('CREATE TABLE IF NOT EXISTS Bike_poiQuickAccess( type TEXT UNIQUE, clause TEXT, distance TEXT )');
1178+ tx.executeSql('CREATE TABLE IF NOT EXISTS Walk_poiQuickAccess( type TEXT UNIQUE, clause TEXT, distance TEXT )');
1179 });
1180 }
1181 }
1182@@ -77,7 +80,7 @@
1183 openDB();
1184 db.transaction( function(tx){
1185 tx.executeSql('INSERT OR REPLACE INTO favHistory(key, lat, lng) VALUES(?,?,?)', [key, parseFloat(lat).toFixed(7).toString(), parseFloat(lng).toFixed(7).toString()]);
1186- tx.executeSql('DELETE FROM favHistory WHERE id IN (SELECT id FROM favHistory ORDER BY id DESC LIMIT -1 OFFSET 3)'); // Keep last 3
1187+ tx.executeSql('DELETE FROM favHistory WHERE id IN (SELECT id FROM favHistory ORDER BY id DESC LIMIT -1 OFFSET 3)'); // Keep last 3
1188 });
1189 }
1190
1191@@ -91,6 +94,7 @@
1192 }
1193
1194 function removeHistoryFavorite(key) {
1195+
1196 openDB();
1197 db.transaction( function(tx){
1198 tx.executeSql('DELETE FROM favHistory WHERE key=?;', [key]);
1199@@ -148,6 +152,39 @@
1200 });
1201 }
1202
1203+// QuickAccess Storage
1204+function saveToQuickAccessItem(mode, type, clause, distance) {
1205+ openDB();
1206+ db.transaction( function(tx){
1207+ tx.executeSql('INSERT OR REPLACE INTO ' + mode +'_poiQuickAccess(type, clause, distance) VALUES(?,?,?)', [type, clause, distance]);
1208+ });
1209+}
1210+
1211+function getQuickAccessItems(mode) {
1212+ var res;
1213+ openDB();
1214+ db.transaction( function(tx) {
1215+ res = tx.executeSql('SELECT * FROM ' + mode +'_poiQuickAccess', []);
1216+ });
1217+ return res;
1218+}
1219+
1220+function countQuickAccessItems(mode) {
1221+ var res;
1222+ openDB();
1223+ db.transaction( function(tx) {
1224+ res = tx.executeSql('SELECT COUNT(*) AS count FROM ' + mode +'_poiQuickAccess', []);
1225+ });
1226+ return res;
1227+}
1228+
1229+function removeQuickAccessItem(mode, key) {
1230+ openDB();
1231+ db.transaction( function(tx){
1232+ tx.executeSql('DELETE FROM ' + mode +'_poiQuickAccess WHERE type=?;', [key]);
1233+ });
1234+}
1235+
1236 // delete historytables
1237 function dropHistoryTables() {
1238 openDB();

Subscribers

People subscribed via source and target branches