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