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: 1030 lines (+766/-76)
10 files modified
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)
qml/Main.qml (+69/-38)
qml/PoiDetailsPage.qml (+1/-1)
qml/PoiListPage.qml (+1/-1)
qml/PoiQuickAccessPage.qml (+230/-0)
qml/components/POIQuickAccessGridView.qml (+177/-0)
qml/js/db.js (+41/-5)
To merge this branch: bzr merge lp:~joergberroth/unav/poi_quick_access_feature
Reviewer Review Type Date Requested Status
Nekhelesh Ramananthan Needs Fixing
costales Needs Fixing
Review via email: mp+293470@code.launchpad.net

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

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 :

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 :

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) :
review: Needs Fixing
Revision history for this message
Nekhelesh Ramananthan (nik90) wrote :

> - 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 :

> 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 :

> > 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 :

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 :

> 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 :

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 :

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 :

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 :

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 :

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 :

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 :

>
> 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 :

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

68. By JkB

* merge with trunk
* minor design fixes
* added Costales fixes, where needed

69. By JkB

*costales icon

70. By JkB

*changed http:// queries to https://

Revision history for this message
costales (costales) wrote :

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 :

@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 :

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 :

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 :

There are code conficts in your branch.

review: Needs Fixing
71. By JkB

*merge with trunk. Fix conflicts

72. By JkB

*fix main.qml
* added decodeURIComponent to the name result of a nav-js reutrn

73. By JkB

*add notification bar.

74. By JkB

*merge costales branch

75. By JkB

* made the notifications more generic.
*wip

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

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
=== 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-09 20:07:06 +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-09 20:07:06 +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-09 20:07:06 +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-09 20:07:06 +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 'qml/Main.qml'
--- qml/Main.qml 2016-04-25 19:52:54 +0000
+++ qml/Main.qml 2016-05-09 20:07:06 +0000
@@ -320,7 +320,7 @@
320 goThereActionPopover.phone = params[5];320 goThereActionPopover.phone = params[5];
321 321
322 if (params[6] !== "none")322 if (params[6] !== "none")
323 goThereActionPopover.poiName = params[6].replace(/¿¿¿/g, "\/");323 goThereActionPopover.poiName = decodeURIComponent(params[6]);
324324
325 mainPageStack.favPopup = false;325 mainPageStack.favPopup = false;
326 goThereActionPopover.show();326 goThereActionPopover.show();
@@ -617,50 +617,81 @@
617617
618 Component {618 Component {
619 id: routeMenu619 id: routeMenu
620 Item {620 Column {
621 width: parent.width621 height: routePageGrid.height + notificationLabel.height
622 height: routePageGrid.height622 spacing: 0
623
624 Component.onCompleted: {623 Component.onCompleted: {
625 mainPageStack.executeJavaScript("qml_set_route_status();")624 mainPageStack.executeJavaScript("qml_set_route_status();")
626 }625 }
627626
628 CustomGridView {627 Row {
629 id: routePageGrid628 id: gridRow
630629 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.horizontalCenter630 anchors.horizontalCenter: parent.horizontalCenter
644631
645 delegate: GridDelegate {632 Loader {
646 id: delegate633 id: poiQuickAccessLoader
647634 sourceComponent: POIQuickAccessGridView {}
648 width: units.gu(9)635 }
649 title: model.text636
650 icon.name: model.iconName637 CustomGridView {
651638 id: routePageGrid
652 onClicked: {639
653 if (model.mode === "DESTINATION") {640 ListModel {
654 mainPageStack.addPageToNextColumn(mainPageStack.primaryPage, Qt.resolvedUrl("PoiPage.qml"), {"lat": mainPageStack.endLat, "lng": mainPageStack.endLng})641 id: routePageModel
655 } else if (model.mode === "CANCEL") {642 Component.onCompleted: initialize()
656 mainPageStack.routeState = 'no';643
657 mainPageStack.executeJavaScript("click_cancel_route();");644 function initialize() {
658 }645 routePageModel.append({mode: "DESTINATION", text: i18n.tr("NearBy Destination"), iconName: "location"})
659 goThereActionPopover.showMenu = false646 routePageModel.append({mode: "CANCEL", text: i18n.tr("Cancel Route"), iconName: "dialog-error-symbolic"})
660 goThereActionPopover.hide()647 }
648 }
649
650 itemWidth: units.gu(8)
651 model: routePageModel
652
653 delegate: GridDelegate {
654 id: delegate
655
656 width: units.gu(8)
657 title: model.text
658 icon.name: model.iconName
659
660 onClicked: {
661 if (model.mode === "DESTINATION") {
662 mainPageStack.addPageToNextColumn(mainPageStack.primaryPage, Qt.resolvedUrl("PoiPage.qml"), {"lat": mainPageStack.endLat, "lng": mainPageStack.endLng})
663 } else if (model.mode === "CANCEL") {
664 mainPageStack.routeState = 'no';
665 mainPageStack.executeJavaScript("click_cancel_route();");
666 }
667 goThereActionPopover.showMenu = false
668 goThereActionPopover.hide()
669 }
661 }670 }
662 }671 }
663 }672 }
673
674 Timer {
675 id: notificationLabelTimer
676 interval: 4000
677 repeat: false
678 onTriggered: notificationLabel.visible = false
679 }
680
681 Label {
682 id: notificationLabel
683 width: parent.width
684 visible: false
685 height: !visible ? 0 : units.gu(3)
686 anchors {
687 top: routeMenu.top
688 topMargin: routePageGrid.height
689 }
690 horizontalAlignment: Text.AlignHCenter
691 verticalAlignment: Text.AlignBottom
692 maximumLineCount: 2
693 wrapMode: Text.WordWrap
694 }
664 }695 }
665 }696 }
666697
@@ -706,9 +737,9 @@
706 mainPageStack.favPopup = !mainPageStack.favPopup;737 mainPageStack.favPopup = !mainPageStack.favPopup;
707 mainPageStack.showSideBar()738 mainPageStack.showSideBar()
708 var incubator = mainPageStack.addPageToNextColumn(mainPageStack.primaryPage, Qt.resolvedUrl("SearchPage.qml"), {favLat: mainPageStack.clickedLat, favLng: mainPageStack.clickedLng, favName: ""});739 var incubator = mainPageStack.addPageToNextColumn(mainPageStack.primaryPage, Qt.resolvedUrl("SearchPage.qml"), {favLat: mainPageStack.clickedLat, favLng: mainPageStack.clickedLng, favName: ""});
709 if (incubator && incubator.status == Component.Loading) {740 if (incubator && incubator.status === Component.Loading) {
710 incubator.onStatusChanged = function(status) {741 incubator.onStatusChanged = function(status) {
711 if (status == Component.Ready) {742 if (status === Component.Ready) {
712 incubator.object.addFavorite()743 incubator.object.addFavorite()
713 }744 }
714 }745 }
715746
=== modified file 'qml/PoiDetailsPage.qml'
--- qml/PoiDetailsPage.qml 2016-04-28 16:07:19 +0000
+++ qml/PoiDetailsPage.qml 2016-05-09 20:07:06 +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-09 20:07:06 +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-09 20:07:06 +0000
@@ -0,0 +1,230 @@
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 categoryListModel.initialize()
45 break;
46 case 2:
47 poiQuickAccessPage.mode = "Bike";
48 categoryListModel.initialize()
49 break;
50 }
51 }
52
53 Component.onDestruction: {
54 // Hide 2nd column when returning to the map to avoid an empty white column
55 if (mainPageStack.columns === 1)
56 mainPageStack.hideSideBar()
57 }
58
59 header: UNavHeader {
60 id: poiQuickAccessHeader
61
62 flickable: categoryList
63 /**
64 leadingActionBar.actions: Action {
65 iconName: "back"
66 text: i18n.tr("Back")
67 onTriggered: {
68 goBackStandardMode()
69 }
70 }
71**/
72 title: i18n.tr("Quick Access: ") + i18n.tr(mode)
73
74 trailingActionBar {
75 numberOfSlots: 4
76 actions: [
77 CloseHeaderAction {},
78
79 Action {
80 id: bikeAction
81 iconSource: "../nav/img/mode/bike.svg"
82 text: i18n.tr("Bike")
83 enabled: poiQuickAccessPage.mode !== text
84 onTriggered: {
85 poiQuickAccessPage.mode = text
86 categoryListModel.initialize()
87 }
88 },
89
90 Action {
91 id: walkAction
92 iconSource: "../nav/img/mode/walk.svg"
93 text: i18n.tr("Walk")
94 enabled: poiQuickAccessPage.mode !== text
95 onTriggered: {
96 poiQuickAccessPage.mode = text
97 categoryListModel.initialize()
98 }
99 },
100
101 Action {
102 id: carAction
103 iconSource: "../nav/img/mode/car.svg"
104 text: i18n.tr("Car")
105 enabled: poiQuickAccessPage.mode !== text
106 onTriggered: {
107 poiQuickAccessPage.mode = text
108 categoryListModel.initialize()
109 }
110 }
111 ]
112 }
113
114 extension: UNavPageSection {
115 id: distanceSections
116 anchors {
117 left: parent.left
118 bottom: parent.bottom
119 }
120
121 model: [factorList[0]+unit, factorList[1]+unit, factorList[2]+unit, factorList[3]+unit, factorList[4]+unit]
122 selectedIndex: 1
123 }
124 }
125
126 ListModel {
127 id: categoryListModel
128 property var indices: []
129 function initialize() {
130 categoryListModel.clear();
131 categoryListModel.indices = [];
132 var res = UnavDB.getQuickAccessItems(poiQuickAccessPage.mode);
133 var len = res.rows.length;
134 for ( var i = 0; i < len; ++i) {
135 categoryListModel.indices.push( res.rows.item(i).type )
136 }
137 Categories.data.forEach( function(category) {
138 categoryListModel.append(category);
139 });
140 categoryList.update()
141 }
142
143 Component.onCompleted: initialize()
144 }
145
146 SortFilterModel {
147 id: sortedCategoryListModel
148 model: categoryListModel
149 filter.property: "label"
150 filter.pattern: RegExp("", "gi")
151 }
152
153 ListView {
154 id: categoryList
155
156 model: sortedCategoryListModel
157 anchors.fill: parent
158 clip: true
159
160 section.property: "theme"
161 section.criteria: ViewSection.FullString
162 section.labelPositioning: ViewSection.CurrentLabelAtStart + ViewSection.InlineLabels
163 section.delegate: Rectangle {
164 width: parent.width
165 height: sectionHeader.height
166
167 ListItemHeader {
168 id: sectionHeader
169 title: section
170 }
171 }
172
173 delegate: ListItem {
174 id: poiItem
175 divider.visible: true
176 height: poiItemLayout.height
177
178 ListItemLayout {
179 id: poiItemLayout
180 title.text: label
181
182 Icon {
183 source: Qt.resolvedUrl("../nav/img/poi/" + model.en_label + ".svg")
184 height: units.gu(2.5)
185 width: height
186 SlotsLayout.position: SlotsLayout.Leading
187 }
188
189 CheckBox {
190 id: quickAccessCheckBox
191 checked: categoryListModel.indices.indexOf(model.en_label) > -1
192 SlotsLayout.position: SlotsLayout.Trailing
193 onClicked: {
194 var count = UnavDB.countQuickAccessItems(poiQuickAccessPage.mode).rows.item(0).count;
195 if (!quickAccessCheckBox.checked) {
196 UnavDB.removeQuickAccessItem( poiQuickAccessPage.mode, model.en_label )
197 } else if (quickAccessCheckBox.checked && count >= poiQuickAccessPage.maxQuickAccessItems ){
198 quickAccessCheckBox.checked = false;
199 PopupUtils.open(maxSelectedDialogComponent);
200 } else if (quickAccessCheckBox.checked && count < poiQuickAccessPage.maxQuickAccessItems ){
201 UnavDB.saveToQuickAccessItem(poiQuickAccessPage.mode, model.en_label, model.clause, factorList[header.extension.selectedIndex])
202 }
203 }
204 }
205 }
206 }
207 }
208
209 Scrollbar {
210 flickableItem: categoryList
211 align: Qt.AlignTrailing
212 }
213
214 Component {
215 id: maxSelectedDialogComponent
216 Dialog {
217 id: maxSelectedDialog
218 title: i18n.tr("Selection")
219 //TRANSLATORS: argument is a number.
220 text: i18n.tr("Max. %1 POIs can be selected.").arg(poiQuickAccessPage.maxQuickAccessItems)
221
222 Button {
223 text: i18n.tr("OK")
224 color: UbuntuColors.orange
225 onClicked: PopupUtils.close(maxSelectedDialog);
226 }
227 }
228 }
229}
230
0231
=== added file 'qml/components/POIQuickAccessGridView.qml'
--- qml/components/POIQuickAccessGridView.qml 1970-01-01 00:00:00 +0000
+++ qml/components/POIQuickAccessGridView.qml 2016-05-09 20:07:06 +0000
@@ -0,0 +1,177 @@
1/*
2 * Copyright (C) 2016 Canonical Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 3, as published
6 * by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranties of
10 * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
11 * PURPOSE. See the GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License along
14 * with this program. If not, see <http://www.gnu.org/licenses/>.
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 notificationLabelTimer.start();
91 notificationLabel.text = i18n.tr("Error getting results. Please, check your data connection.");
92 notificationLabel.visible = true;
93 }
94 if (status === XmlListModel.Ready && count === 0) {
95 notificationLabelTimer.start();
96 notificationLabel.text = i18n.tr("Sorry, no results found nearby.")
97 notificationLabel.visible = true;
98 }
99 if (status === XmlListModel.Ready && count >> 0) {
100 mainPageStack.executeJavaScript("ui.markers_POI_set(" + JSON.stringify(poiXmlModel.allPOI()) + ")");
101 }
102 }
103
104 readonly property string baseUrl: "https://nominatim.openstreetmap.org/search?format=xml&bounded=1&limit=50&email=costales.marcos@gmail.com&extratags=1"
105 readonly property double geoDist: navApp.settings.unit === 0 ? 0.01 : 0.01 / 0.621371192
106 // geographic distance ~1.1km / ~1.1mi
107 // rough estimation only. Could be redefined.
108
109 function search() {
110 // Boxed area in which to search for PoI
111 var bbox = ( Number(mainPageStack.currentLng) - geoDist*distance).toString() + ","
112 + ( Number(mainPageStack.currentLat) - geoDist*distance).toString() + ","
113 + ( Number(mainPageStack.currentLng) + geoDist*distance).toString() + ","
114 + ( Number(mainPageStack.currentLat) + geoDist*distance).toString();
115 source = (baseUrl + "&q=" + clause + "&viewbox=" + bbox);
116 }
117 function clear() {
118 source = "";
119 }
120
121 source: ""
122 query: "/searchresults/place"
123
124 XmlRole { name: "osm_type"; query: "@osm_type/string()"; }
125 XmlRole { name: "osm_id"; query: "@osm_id/string()"; }
126 XmlRole { name: "name"; query: "@display_name/string()"; }
127 XmlRole { name: "phone"; query: "extratags/tag[@key='phone']/@value/string()"; }
128 XmlRole { name: "lat"; query: "@lat/string()"; }
129 XmlRole { name: "lng"; query: "@lon/string()"; }
130 }
131
132 Repeater {
133
134 model: quickAccessModel
135
136 delegate: AbstractButton {
137 id: button
138 width: units.gu(4)
139 height: width
140 opacity: button.pressed ? 0.5 : (enabled ? 1 : 0.2)
141
142 Behavior on opacity {
143 UbuntuNumberAnimation { }
144 }
145
146 UbuntuShape {
147 id: shape
148
149 aspect: UbuntuShape.Flat
150 anchors.fill: parent
151 radius: "medium"
152 }
153
154 Icon {
155 source: model.label !== "add" ? Qt.resolvedUrl("../../nav/img/poi/" + model.en_label + ".svg"): "../../nav/img/header/poiConfig.svg"
156 opacity: 0.6 //model.label === "add" ? 1 :0.6
157 width: units.gu(3.25)
158 enabled: navigationPage.buttonsEnabled
159
160 anchors.centerIn: parent
161 color: UbuntuColors.slate
162 }
163 onClicked: {
164 if (model.label === "add") {
165 goThereActionPopover.hide()
166 mainPageStack.showSideBar()
167 mainPageStack.addPageToNextColumn(mainPageStack.primaryPage, Qt.resolvedUrl("../PoiQuickAccessPage.qml"))
168 } else {
169 poiXmlModel.distance = model.distance;
170 poiXmlModel.clause = model.clause;
171 poiXmlModel.search();
172 }
173 }
174 }
175 }
176}
177
0178
=== modified file 'qml/js/db.js'
--- qml/js/db.js 2016-04-17 14:08:53 +0000
+++ qml/js/db.js 2016-05-09 20:07:06 +0000
@@ -22,11 +22,14 @@
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 });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 )');
32 });
30 }33 }
31}34}
3235
@@ -148,6 +151,39 @@
148 });151 });
149}152}
150153
154// QuickAccess Storage
155function saveToQuickAccessItem(mode, type, clause, distance) {
156 openDB();
157 db.transaction( function(tx){
158 tx.executeSql('INSERT OR REPLACE INTO ' + mode +'_poiQuickAccess(type, clause, distance) VALUES(?,?,?)', [type, clause, distance]);
159 });
160}
161
162function getQuickAccessItems(mode) {
163 var res;
164 openDB();
165 db.transaction( function(tx) {
166 res = tx.executeSql('SELECT * FROM ' + mode +'_poiQuickAccess', []);
167 });
168 return res;
169}
170
171function countQuickAccessItems(mode) {
172 var res;
173 openDB();
174 db.transaction( function(tx) {
175 res = tx.executeSql('SELECT COUNT(*) AS count FROM ' + mode +'_poiQuickAccess', []);
176 });
177 return res;
178}
179
180function removeQuickAccessItem(mode, key) {
181 openDB();
182 db.transaction( function(tx){
183 tx.executeSql('DELETE FROM ' + mode +'_poiQuickAccess WHERE type=?;', [key]);
184 });
185}
186
151// delete historytables187// delete historytables
152function dropHistoryTables() {188function dropHistoryTables() {
153 openDB();189 openDB();

Subscribers

People subscribed via source and target branches