Merge lp:~costales/unav/0.62-addTopoMap into lp:unav
- 0.62-addTopoMap
- Merge into trunk
Proposed by
costales
Status: | Merged |
---|---|
Merged at revision: | 100 |
Proposed branch: | lp:~costales/unav/0.62-addTopoMap |
Merge into: | lp:unav |
Prerequisite: | lp:~joergberroth/unav/addTopoMap |
Diff against target: |
914 lines (+253/-171) 7 files modified
nav/class/Navigator.js (+14/-5) nav/class/UI.js (+71/-41) nav/index.html (+33/-9) nav/locales/unav.pot (+92/-92) qml/AboutPage.qml (+1/-0) qml/Main.qml (+17/-18) qml/SettingsPage.qml (+25/-6) |
To merge this branch: | bzr merge lp:~costales/unav/0.62-addTopoMap |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
JkB | Pending | ||
Review via email: mp+302157@code.launchpad.net |
This proposal supersedes a proposal from 2016-08-04.
Commit message
Dynamic layers
Description of the change
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'nav/class/Navigator.js' |
2 | --- nav/class/Navigator.js 2016-07-15 13:42:30 +0000 |
3 | +++ nav/class/Navigator.js 2016-08-05 14:42:08 +0000 |
4 | @@ -31,7 +31,9 @@ |
5 | |
6 | this.accuracy = this.ACCU4DRIVE + 1; |
7 | this.speed = null; |
8 | - |
9 | + |
10 | + this.verbose_ind = false; |
11 | + |
12 | this.route = new Object(); |
13 | this.route['start_check_out'] = false; |
14 | this.route['status'] = 'no'; // no | errorAPI | waiting4signal | calc | drawing | 2review | yes | out | ended |
15 | @@ -64,12 +66,12 @@ |
16 | } |
17 | |
18 | Navigator.prototype.ACCU4DRIVE = 250; |
19 | -Navigator.prototype.IS_IN_ROUTE = 50; |
20 | +Navigator.prototype.IS_IN_ROUTE = 60; |
21 | Navigator.prototype.MAX_START_CHECK_OUT = 250; |
22 | Navigator.prototype.DIST4INDICATION = 99; // Never > 99 for preserve voices |
23 | Navigator.prototype.SPEED_CITY = 62; |
24 | Navigator.prototype.SPEED_INTERCITY = 82; |
25 | -Navigator.prototype.DIST_RADAR_IN_ROUTE = 27; |
26 | +Navigator.prototype.DIST_RADAR_IN_ROUTE = 32; |
27 | Navigator.prototype.NUM_RADARS_MAX = 100; |
28 | |
29 | |
30 | @@ -96,7 +98,11 @@ |
31 | }; |
32 | } |
33 | |
34 | -Navigator.prototype.radars_clear = function () { |
35 | +Navigator.prototype.set_verbose_indications = function(verbose) { |
36 | + this.verbose_ind = verbose; |
37 | +} |
38 | + |
39 | +Navigator.prototype.radars_clear = function() { |
40 | this.route['radars'] = []; |
41 | } |
42 | |
43 | @@ -224,7 +230,7 @@ |
44 | } |
45 | } |
46 | |
47 | - if (this.ui_lang == 'en' || this.ui_lang == 'e1' || this.ui_lang == 'e2') |
48 | + if (this.verbose_ind && (this.ui_lang == 'en' || this.ui_lang == 'e1' || this.ui_lang == 'e2')) // English and Not verbose = From Mapzen |
49 | instruction = tracks[i].instruction.slice(0, -1); |
50 | else |
51 | instruction = this.compose_instruction( |
52 | @@ -418,6 +424,9 @@ |
53 | break; |
54 | } |
55 | |
56 | + if (!this.verbose_ind) |
57 | + return instruction; |
58 | + |
59 | var number = ''; |
60 | var branch = ''; |
61 | var toward = ''; |
62 | |
63 | === modified file 'nav/class/UI.js' |
64 | --- nav/class/UI.js 2016-08-05 14:42:08 +0000 |
65 | +++ nav/class/UI.js 2016-08-05 14:42:08 +0000 |
66 | @@ -97,8 +97,43 @@ |
67 | }); |
68 | this.map.addLayer(route_line); |
69 | |
70 | + this.online_layer = 0; |
71 | + |
72 | this.scaleline = new ol.control.ScaleLine(); |
73 | this.map.addControl(this.scaleline); |
74 | + |
75 | + this.map_attributions = { |
76 | + 0: { |
77 | + license: "<span onclick=\"qml_go_url('https://mapzen.com')\">© Mapzen</span> <span onclick=\"qml_go_url('http://www.openstreetmap.org/copyright')\">© OpenStreetMap contributors</span> <span onclick=\"qml_go_url('http://creativecommons.org/licenses/by-sa/2.0/')\">. CC-BY-SA</span>", |
78 | + width: '340px', |
79 | + left: '-160px' |
80 | + }, |
81 | + 1: { |
82 | + license: "<span onclick=\"qml_go_url('https://mapzen.com')\">© Mapzen</span> <span onclick=\"qml_go_url('http://stamen.com')\">© Stamen</span> <span onclick=\"qml_go_url('http://www.openstreetmap.org/copyright')\">© OpenStreetMap contributors</span>", |
83 | + width: '340px', |
84 | + left: '-160px' |
85 | + }, |
86 | + 2: { |
87 | + license: "<span onclick=\"qml_go_url('https://mapzen.com')\">© Mapzen</span> <span onclick=\"qml_go_url('http://stamen.com')\">© Stamen</span> <span onclick=\"qml_go_url('http://www.openstreetmap.org/copyright')\">© OpenStreetMap contributors</span>", |
88 | + width: '340px', |
89 | + left: '-160px' |
90 | + }, |
91 | + 3: { |
92 | + license: "<span onclick=\"qml_go_url('https://mapzen.com')\">© Mapzen</span> <span onclick=\"qml_go_url('http://opentopomap.org')\">© OpenTopoMap</span> <span onclick=\"qml_go_url('http://www.openstreetmap.org/copyright')\">© OpenStreetMap contributors</span>", |
93 | + width: '380px', |
94 | + left: '-180px' |
95 | + }, |
96 | + 4: { |
97 | + license: "<span onclick=\"qml_go_url('https://mapzen.com')\">© Mapzen</span> <span onclick=\"qml_go_url('https://www.mapbox.com')\">© Mapbox</span> <span onclick=\"qml_go_url('http://www.openstreetmap.org/copyright')\">© OpenStreetMap contributors</span>", |
98 | + width: '340px', |
99 | + left: '-160px' |
100 | + }, |
101 | + 5: { |
102 | + license: "Dummy", |
103 | + width: '340px', |
104 | + left: '-160px' |
105 | + } |
106 | + }; |
107 | } |
108 | |
109 | UI.prototype.ZOOM_CITY = 17; |
110 | @@ -124,46 +159,39 @@ |
111 | return this.center_onpos; |
112 | } |
113 | |
114 | +UI.prototype.get_map_layer = function() { |
115 | + return this.online_layer; |
116 | +} |
117 | + |
118 | UI.prototype.set_map_layer = function(layer) { |
119 | - switch (layer) { |
120 | - case 1: // terrain |
121 | - this.map.getLayers().getArray()[0].setVisible(true); // Online terrain |
122 | - this.map.getLayers().getArray()[1].setVisible(false); // Online OSM |
123 | - this.map.getLayers().getArray()[2].setVisible(false); // topo |
124 | - this.map.getLayers().getArray()[3].setVisible(false); // Offline |
125 | - $('#map_attribution').html("<span onclick=\"qml_go_url('https://mapzen.com')\">© Mapzen</span> <span onclick=\"qml_go_url('http://stamen.com')\">© Stamen</span> <span onclick=\"qml_go_url('http://www.openstreetmap.org/copyright')\">© OpenStreetMap contributors</span>"); |
126 | - $('#map_attribution').css({'width': '340px', 'left': '-160px'}); |
127 | - $('#map_attribution').show(); |
128 | - $(".map").removeClass('body_bg'); |
129 | - break; |
130 | - case 0: // OSM |
131 | - this.map.getLayers().getArray()[0].setVisible(false); // Online terrain |
132 | - this.map.getLayers().getArray()[1].setVisible(true); // Online OSM |
133 | - this.map.getLayers().getArray()[2].setVisible(false); // topo |
134 | - this.map.getLayers().getArray()[3].setVisible(false); // Offline |
135 | - $('#map_attribution').html("<span onclick=\"qml_go_url('https://mapzen.com')\">© Mapzen</span> <span onclick=\"qml_go_url('http://www.openstreetmap.org/copyright')\">© OpenStreetMap contributors</span>"); |
136 | - $('#map_attribution').css({'width': '280px', 'left': '-130px'}); |
137 | - $('#map_attribution').show(); |
138 | - $(".map").removeClass('body_bg'); |
139 | - break; |
140 | - case 2: //topo |
141 | - this.map.getLayers().getArray()[0].setVisible(false); // Online terrain |
142 | - this.map.getLayers().getArray()[1].setVisible(false); // Online OSM |
143 | - this.map.getLayers().getArray()[2].setVisible(true); // topo |
144 | - this.map.getLayers().getArray()[3].setVisible(false); // Offline |
145 | - $('#map_attribution').html("<span onclick=\"qml_go_url('https://mapzen.com')\">© Mapzen</span> <span onclick=\"qml_go_url('http://www.openstreetmap.org/copyright')\">© OpenStreetMap contributors</span> <span onclick=\"qml_go_url('http://opentopomap.org')\">© OpenTopoMap</span>"); |
146 | - $('#map_attribution').css({'width': '380px', 'left': '-180px'}); |
147 | - $('#map_attribution').show(); |
148 | - $(".map").removeClass('body_bg'); |
149 | - break; |
150 | - case 3: //offline |
151 | - this.map.getLayers().getArray()[0].setVisible(false); // Online terrain |
152 | - this.map.getLayers().getArray()[1].setVisible(false); // Online OSM |
153 | - this.map.getLayers().getArray()[2].setVisible(false); // topo |
154 | - this.map.getLayers().getArray()[3].setVisible(true); // Offline |
155 | - $('#map_attribution').hide(); |
156 | - $(".map").addClass('body_bg'); |
157 | - break; |
158 | + var layers_max_ind = this.map.getLayers().getArray().length - 2; // Route is another layer (6 map layers = 0 to 5) |
159 | + |
160 | + if (layer == 99) // Independent of number of layers |
161 | + layer = layers_max_ind; |
162 | + if (layer > layers_max_ind) // Assure auto works if a layer is removed in future |
163 | + layer = 0; |
164 | + |
165 | + this.online_layer = layer; |
166 | + |
167 | + // 0 OSM, 1 Terrain, 2 Toner, 3 OpenTopoMap, 4 Mapbox, Last=Offline |
168 | + for (i=0; i<=layers_max_ind; i++) { |
169 | + if (i == layer) { |
170 | + this.map.getLayers().getArray()[i].setVisible(true); |
171 | + $('#map_attribution').html(this.map_attributions[i]['license']); |
172 | + $('#map_attribution').css({'width': this.map_attributions[i]['width'], 'left': this.map_attributions[i]['left']}); |
173 | + } |
174 | + else { |
175 | + this.map.getLayers().getArray()[i].setVisible(false); |
176 | + } |
177 | + } |
178 | + |
179 | + if (layer == layers_max_ind) { |
180 | + $('#map_attribution').hide(); |
181 | + $(".map").addClass('body_bg'); |
182 | + } |
183 | + else { |
184 | + $('#map_attribution').show(); |
185 | + $(".map").removeClass('body_bg'); |
186 | } |
187 | } |
188 | |
189 | @@ -380,14 +408,16 @@ |
190 | this.map.beforeRender(pan, zoom); |
191 | if (pois.length === 1) { |
192 | this.map.getView().setCenter(ol.proj.transform([pois[0].lng, pois[0].lat], 'EPSG:4326', 'EPSG:3857')); |
193 | + // Adjust zoom if so big |
194 | + if (this.map.getView().getZoom() < 8) |
195 | + this.map.getView().setZoom(8); |
196 | // Adjust map to boundbox |
197 | if (typeof pois[0].boundingbox !== 'undefined' && pois[0].boundingbox !== 'undefined') { |
198 | var coords_bound = pois[0].boundingbox.split(','); |
199 | var extent_aux = [parseFloat(coords_bound[2]), parseFloat(coords_bound[0]), parseFloat(coords_bound[3]), parseFloat(coords_bound[1])]; |
200 | extent_aux = ol.extent.applyTransform(extent_aux, ol.proj.getTransform("EPSG:4326", "EPSG:3857")); |
201 | - this.map.getView().fit(extent_aux, this.map.getSize()); |
202 | + this.map.getView().fit(extent_aux, this.map.getSize(), this.map.getSize(), {padding: [200, 15, 200, 15]}); |
203 | } |
204 | - |
205 | osm_type = 'none'; |
206 | osm_id = 'none'; |
207 | phone = 'none'; |
208 | |
209 | === modified file 'nav/index.html' |
210 | --- nav/index.html 2016-08-05 14:42:08 +0000 |
211 | +++ nav/index.html 2016-08-05 14:42:08 +0000 |
212 | @@ -198,25 +198,46 @@ |
213 | <!-- Map --> |
214 | <script src="libraries/ol.js"></script> |
215 | <script> |
216 | + var map_layers = []; |
217 | + |
218 | + var online_layer_OSM = new ol.layer.Tile({ |
219 | + source: new ol.source.OSM({url: 'http://{a-c}.osm.maptiles.xyz/{z}/{x}/{y}.png'}), |
220 | + visible: false |
221 | + }); |
222 | + map_layers.push(online_layer_OSM); |
223 | + |
224 | var online_layer_terrain = new ol.layer.Tile({ |
225 | source: new ol.source.Stamen({layer: 'terrain'}), |
226 | visible: false |
227 | }); |
228 | - var online_layer_OSM = new ol.layer.Tile({ |
229 | - source: new ol.source.OSM({url: 'http://{a-c}.osm.maptiles.xyz/{z}/{x}/{y}.png'}), |
230 | - visible: false |
231 | - }); |
232 | - var online_layer_topo = new ol.layer.Tile({ |
233 | - source: new ol.source.OSM({url: 'http://{a-c}.tile.opentopomap.org/{z}/{x}/{y}.png'}), |
234 | - visible: false |
235 | - }); |
236 | + map_layers.push(online_layer_terrain); |
237 | + |
238 | + var online_layer_toner_lite = new ol.layer.Tile({ |
239 | + source: new ol.source.Stamen({layer: 'toner-lite'}), |
240 | + visible: false |
241 | + }); |
242 | + map_layers.push(online_layer_toner_lite); |
243 | + |
244 | + var online_layer_topo = new ol.layer.Tile({ |
245 | + source: new ol.source.OSM({url: 'http://{a-c}.tile.opentopomap.org/{z}/{x}/{y}.png'}), |
246 | + visible: false |
247 | + }); |
248 | + map_layers.push(online_layer_topo); |
249 | + |
250 | + var online_layer_mapbox = new ol.layer.Tile({ |
251 | + source: new ol.source.OSM({url: 'http://api.tiles.mapbox.com/v4/costales.03e98a7c/{z}/{x}/{y}.png?access_token=unav_api'}), //TODO change api |
252 | + visible: false |
253 | + }); |
254 | + map_layers.push(online_layer_mapbox); |
255 | + |
256 | var offline_layer = new ol.layer.Tile({ |
257 | source: new ol.source.OSM({url: '/home/phablet/.local/share/navigator.costales/maps/{z}/{x}/{y}.png'}), |
258 | visible: false |
259 | }); |
260 | + map_layers.push(offline_layer); |
261 | |
262 | var map = new ol.Map({ |
263 | - layers: [online_layer_terrain, online_layer_OSM, online_layer_topo, offline_layer], |
264 | + layers: map_layers, |
265 | controls: [], |
266 | target: 'map', |
267 | view: new ol.View({ |
268 | @@ -436,6 +457,9 @@ |
269 | |
270 | // Zoom |
271 | function custom_zoom(value) { |
272 | + if (ui.get_map_layer() == 3 && value == 1 && map.getView().getZoom() == 17) // Avoid zoom 18 in OpenTopoMap |
273 | + return; |
274 | + |
275 | ui.set_zoom_unav(false); |
276 | |
277 | var zoom = ol.animation.zoom({duration: 300, resolution: map.getView().getResolution(), easing: ol.easing.linear}); |
278 | |
279 | === modified file 'nav/locales/unav.pot' |
280 | --- nav/locales/unav.pot 2016-08-02 14:27:10 +0000 |
281 | +++ nav/locales/unav.pot 2016-08-05 14:42:08 +0000 |
282 | @@ -8,7 +8,7 @@ |
283 | msgstr "" |
284 | "Project-Id-Version: PACKAGE VERSION\n" |
285 | "Report-Msgid-Bugs-To: \n" |
286 | -"POT-Creation-Date: 2016-08-02 16:26+0200\n" |
287 | +"POT-Creation-Date: 2016-08-04 19:39+0200\n" |
288 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" |
289 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
290 | "Language-Team: LANGUAGE <LL@li.org>\n" |
291 | @@ -72,12 +72,12 @@ |
292 | #: qml/AboutPage.qml:83 qml/AboutPage.qml:84 qml/AboutPage.qml:85 |
293 | #: qml/AboutPage.qml:86 qml/AboutPage.qml:87 qml/AboutPage.qml:88 |
294 | #: qml/AboutPage.qml:89 qml/AboutPage.qml:90 qml/AboutPage.qml:91 |
295 | -#: qml/AboutPage.qml:92 |
296 | +#: qml/AboutPage.qml:92 qml/AboutPage.qml:93 |
297 | msgid "Powered by" |
298 | msgstr "" |
299 | |
300 | #. TRANSLATORS: %1 and %2 are links that do not have to be translated: Year + Project + License |
301 | -#: qml/AboutPage.qml:133 |
302 | +#: qml/AboutPage.qml:134 |
303 | #, qt-format |
304 | msgid "Version %1. Under License %2" |
305 | msgstr "" |
306 | @@ -146,11 +146,11 @@ |
307 | msgid "Insert a favorite name" |
308 | msgstr "" |
309 | |
310 | -#: qml/Favorites.qml:214 qml/Main.qml:770 nav/class/UI.js:38 |
311 | +#: qml/Favorites.qml:214 qml/Main.qml:766 nav/class/UI.js:38 |
312 | msgid "Current Position" |
313 | msgstr "" |
314 | |
315 | -#: qml/Favorites.qml:229 qml/SettingsPage.qml:423 |
316 | +#: qml/Favorites.qml:229 qml/SettingsPage.qml:435 |
317 | msgid "Cancel" |
318 | msgstr "" |
319 | |
320 | @@ -205,60 +205,60 @@ |
321 | msgid "Searching…" |
322 | msgstr "" |
323 | |
324 | -#: qml/Main.qml:204 qml/SettingsPage.qml:35 |
325 | +#: qml/Main.qml:205 qml/SettingsPage.qml:35 |
326 | msgid "Settings" |
327 | msgstr "" |
328 | |
329 | -#: qml/Main.qml:215 |
330 | +#: qml/Main.qml:216 |
331 | msgid "Center on Position" |
332 | msgstr "" |
333 | |
334 | -#: qml/Main.qml:219 qml/Main.qml:528 |
335 | +#: qml/Main.qml:220 qml/Main.qml:524 |
336 | msgid "Searching your position… This could take a while" |
337 | msgstr "" |
338 | |
339 | -#: qml/Main.qml:233 qml/PoiPage.qml:83 qml/SearchPage.qml:69 |
340 | +#: qml/Main.qml:234 qml/PoiPage.qml:83 qml/SearchPage.qml:69 |
341 | msgid "Search" |
342 | msgstr "" |
343 | |
344 | -#: qml/Main.qml:244 |
345 | +#: qml/Main.qml:245 |
346 | msgid "Destination" |
347 | msgstr "" |
348 | |
349 | -#: qml/Main.qml:399 |
350 | +#: qml/Main.qml:400 |
351 | msgid "Error getting speed cameras!" |
352 | msgstr "" |
353 | |
354 | -#: qml/Main.qml:402 |
355 | +#: qml/Main.qml:403 |
356 | msgid "Error finding route! Retrying again in 30 seconds…" |
357 | msgstr "" |
358 | |
359 | -#: qml/Main.qml:405 |
360 | +#: qml/Main.qml:406 |
361 | msgid "Error finding route! Trying again…" |
362 | msgstr "" |
363 | |
364 | -#: qml/Main.qml:456 qml/Main.qml:482 |
365 | +#: qml/Main.qml:452 qml/Main.qml:478 |
366 | msgid "Shared Position" |
367 | msgstr "" |
368 | |
369 | -#: qml/Main.qml:713 |
370 | +#: qml/Main.qml:709 |
371 | msgid "NearBy Destination" |
372 | msgstr "" |
373 | |
374 | -#: qml/Main.qml:714 |
375 | +#: qml/Main.qml:710 |
376 | msgid "Cancel Route" |
377 | msgstr "" |
378 | |
379 | -#: qml/Main.qml:759 |
380 | +#: qml/Main.qml:755 |
381 | #, qt-format |
382 | msgid "Coord: %1, %2" |
383 | msgstr "" |
384 | |
385 | -#: qml/Main.qml:827 qml/PoiDetailsPage.qml:225 |
386 | +#: qml/Main.qml:823 qml/PoiDetailsPage.qml:225 |
387 | msgid "Simulate from here! Now click on destination" |
388 | msgstr "" |
389 | |
390 | -#: qml/Main.qml:844 |
391 | +#: qml/Main.qml:840 |
392 | msgid "Set a different coordinates for simulating" |
393 | msgstr "" |
394 | |
395 | @@ -354,7 +354,7 @@ |
396 | msgid "Max. %1 POIs can be selected." |
397 | msgstr "" |
398 | |
399 | -#: qml/PoiQuickAccessPage.qml:206 qml/SettingsPage.qml:444 |
400 | +#: qml/PoiQuickAccessPage.qml:206 qml/SettingsPage.qml:456 |
401 | msgid "OK" |
402 | msgstr "" |
403 | |
404 | @@ -420,87 +420,87 @@ |
405 | msgid "Miles" |
406 | msgstr "" |
407 | |
408 | -#: qml/SettingsPage.qml:92 |
409 | -msgid "Terrain" |
410 | -msgstr "" |
411 | - |
412 | -#: qml/SettingsPage.qml:102 |
413 | +#: qml/SettingsPage.qml:103 |
414 | msgid "Online" |
415 | msgstr "" |
416 | |
417 | -#: qml/SettingsPage.qml:103 |
418 | +#: qml/SettingsPage.qml:104 |
419 | msgid "Offline" |
420 | msgstr "" |
421 | |
422 | -#: qml/SettingsPage.qml:125 |
423 | +#: qml/SettingsPage.qml:126 |
424 | msgid "Navigation" |
425 | msgstr "" |
426 | |
427 | -#: qml/SettingsPage.qml:132 |
428 | +#: qml/SettingsPage.qml:133 |
429 | msgid "Navigation Mode" |
430 | msgstr "" |
431 | |
432 | #: qml/SettingsPage.qml:166 |
433 | +msgid "Verbose Indications" |
434 | +msgstr "" |
435 | + |
436 | +#: qml/SettingsPage.qml:184 |
437 | msgid "Avoid Tolls" |
438 | msgstr "" |
439 | |
440 | -#: qml/SettingsPage.qml:184 |
441 | +#: qml/SettingsPage.qml:202 |
442 | msgid "Speed Camera Alerts" |
443 | msgstr "" |
444 | |
445 | -#: qml/SettingsPage.qml:205 |
446 | +#: qml/SettingsPage.qml:223 |
447 | msgid "Guidance" |
448 | msgstr "" |
449 | |
450 | -#: qml/SettingsPage.qml:236 |
451 | +#: qml/SettingsPage.qml:254 |
452 | msgid "Map" |
453 | msgstr "" |
454 | |
455 | -#: qml/SettingsPage.qml:243 |
456 | +#: qml/SettingsPage.qml:261 |
457 | msgid "Mode" |
458 | msgstr "" |
459 | |
460 | -#: qml/SettingsPage.qml:281 |
461 | +#: qml/SettingsPage.qml:296 |
462 | msgid "How to use offline maps" |
463 | msgstr "" |
464 | |
465 | -#: qml/SettingsPage.qml:298 |
466 | +#: qml/SettingsPage.qml:313 |
467 | msgid "Online Style" |
468 | msgstr "" |
469 | |
470 | -#: qml/SettingsPage.qml:335 |
471 | +#: qml/SettingsPage.qml:347 |
472 | msgid "Units" |
473 | msgstr "" |
474 | |
475 | -#: qml/SettingsPage.qml:369 |
476 | +#: qml/SettingsPage.qml:381 |
477 | msgid "Show header in map view" |
478 | msgstr "" |
479 | |
480 | -#: qml/SettingsPage.qml:381 |
481 | +#: qml/SettingsPage.qml:393 |
482 | msgid "History" |
483 | msgstr "" |
484 | |
485 | -#: qml/SettingsPage.qml:388 |
486 | +#: qml/SettingsPage.qml:400 |
487 | msgid "Store new searches" |
488 | msgstr "" |
489 | |
490 | -#: qml/SettingsPage.qml:400 qml/SettingsPage.qml:410 |
491 | +#: qml/SettingsPage.qml:412 qml/SettingsPage.qml:422 |
492 | msgid "Clear History" |
493 | msgstr "" |
494 | |
495 | -#: qml/SettingsPage.qml:411 |
496 | +#: qml/SettingsPage.qml:423 |
497 | msgid "You'll delete the current history" |
498 | msgstr "" |
499 | |
500 | -#: qml/SettingsPage.qml:414 |
501 | +#: qml/SettingsPage.qml:426 |
502 | msgid "Delete" |
503 | msgstr "" |
504 | |
505 | -#: qml/SettingsPage.qml:433 |
506 | +#: qml/SettingsPage.qml:445 |
507 | msgid "Speed Camera alerts and the law" |
508 | msgstr "" |
509 | |
510 | -#: qml/SettingsPage.qml:434 |
511 | +#: qml/SettingsPage.qml:446 |
512 | msgid "" |
513 | "uNav is only reading the OpenStreetMap database.\n" |
514 | "uNav will show a max speed notification and a Speed Camera marker (marker " |
515 | @@ -510,7 +510,7 @@ |
516 | "only if it's legal in the country." |
517 | msgstr "" |
518 | |
519 | -#: qml/SettingsPage.qml:440 |
520 | +#: qml/SettingsPage.qml:452 |
521 | msgid "Read more about it" |
522 | msgstr "" |
523 | |
524 | @@ -1024,159 +1024,159 @@ |
525 | msgid "Town Hall" |
526 | msgstr "" |
527 | |
528 | -#: nav/class/Navigator.js:253 |
529 | +#: nav/class/Navigator.js:259 |
530 | msgid "You are near to the destination" |
531 | msgstr "" |
532 | |
533 | -#: nav/class/Navigator.js:279 |
534 | +#: nav/class/Navigator.js:285 |
535 | msgid "Go" |
536 | msgstr "" |
537 | |
538 | -#: nav/class/Navigator.js:282 |
539 | +#: nav/class/Navigator.js:288 |
540 | msgid "Go to your right" |
541 | msgstr "" |
542 | |
543 | -#: nav/class/Navigator.js:285 |
544 | +#: nav/class/Navigator.js:291 |
545 | msgid "Go to your left" |
546 | msgstr "" |
547 | |
548 | -#: nav/class/Navigator.js:288 nav/class/UI.js:477 |
549 | +#: nav/class/Navigator.js:294 nav/class/UI.js:504 |
550 | msgid "You have arrived at your destination" |
551 | msgstr "" |
552 | |
553 | -#: nav/class/Navigator.js:291 |
554 | +#: nav/class/Navigator.js:297 |
555 | msgid "Your destination is on the right" |
556 | msgstr "" |
557 | |
558 | -#: nav/class/Navigator.js:294 |
559 | +#: nav/class/Navigator.js:300 |
560 | msgid "Your destination is on the left" |
561 | msgstr "" |
562 | |
563 | -#: nav/class/Navigator.js:297 |
564 | +#: nav/class/Navigator.js:303 |
565 | msgid "Current road becomes" |
566 | msgstr "" |
567 | |
568 | -#: nav/class/Navigator.js:300 |
569 | +#: nav/class/Navigator.js:306 |
570 | msgid "Continue" |
571 | msgstr "" |
572 | |
573 | -#: nav/class/Navigator.js:303 |
574 | +#: nav/class/Navigator.js:309 |
575 | msgid "Bear right" |
576 | msgstr "" |
577 | |
578 | -#: nav/class/Navigator.js:306 |
579 | +#: nav/class/Navigator.js:312 |
580 | msgid "Turn right" |
581 | msgstr "" |
582 | |
583 | -#: nav/class/Navigator.js:309 |
584 | +#: nav/class/Navigator.js:315 |
585 | msgid "Make a sharp right" |
586 | msgstr "" |
587 | |
588 | -#: nav/class/Navigator.js:312 |
589 | +#: nav/class/Navigator.js:318 |
590 | msgid "Make a right U-turn" |
591 | msgstr "" |
592 | |
593 | -#: nav/class/Navigator.js:315 |
594 | +#: nav/class/Navigator.js:321 |
595 | msgid "Make a left U-turn" |
596 | msgstr "" |
597 | |
598 | -#: nav/class/Navigator.js:318 |
599 | +#: nav/class/Navigator.js:324 |
600 | msgid "Make a sharp left" |
601 | msgstr "" |
602 | |
603 | -#: nav/class/Navigator.js:321 |
604 | +#: nav/class/Navigator.js:327 |
605 | msgid "Turn left" |
606 | msgstr "" |
607 | |
608 | -#: nav/class/Navigator.js:324 |
609 | +#: nav/class/Navigator.js:330 |
610 | msgid "Bear left" |
611 | msgstr "" |
612 | |
613 | -#: nav/class/Navigator.js:327 |
614 | +#: nav/class/Navigator.js:333 |
615 | msgid "Stay straight on ramp" |
616 | msgstr "" |
617 | |
618 | -#: nav/class/Navigator.js:330 |
619 | +#: nav/class/Navigator.js:336 |
620 | msgid "Turn right on ramp" |
621 | msgstr "" |
622 | |
623 | -#: nav/class/Navigator.js:333 |
624 | +#: nav/class/Navigator.js:339 |
625 | msgid "Turn left on ramp" |
626 | msgstr "" |
627 | |
628 | -#: nav/class/Navigator.js:336 |
629 | +#: nav/class/Navigator.js:342 |
630 | msgid "Take the exit on the right" |
631 | msgstr "" |
632 | |
633 | -#: nav/class/Navigator.js:339 |
634 | +#: nav/class/Navigator.js:345 |
635 | msgid "Take the exit on the left" |
636 | msgstr "" |
637 | |
638 | -#: nav/class/Navigator.js:342 |
639 | +#: nav/class/Navigator.js:348 |
640 | msgid "Keep straight at the fork" |
641 | msgstr "" |
642 | |
643 | -#: nav/class/Navigator.js:345 |
644 | +#: nav/class/Navigator.js:351 |
645 | msgid "Keep right at the fork" |
646 | msgstr "" |
647 | |
648 | -#: nav/class/Navigator.js:348 |
649 | +#: nav/class/Navigator.js:354 |
650 | msgid "Keep left at the fork" |
651 | msgstr "" |
652 | |
653 | -#: nav/class/Navigator.js:351 |
654 | +#: nav/class/Navigator.js:357 |
655 | msgid "Merge" |
656 | msgstr "" |
657 | |
658 | -#: nav/class/Navigator.js:354 |
659 | +#: nav/class/Navigator.js:360 |
660 | msgid "Enter the roundabout" |
661 | msgstr "" |
662 | |
663 | -#: nav/class/Navigator.js:357 nav/class/Navigator.js:360 |
664 | #: nav/class/Navigator.js:363 nav/class/Navigator.js:366 |
665 | #: nav/class/Navigator.js:369 nav/class/Navigator.js:372 |
666 | #: nav/class/Navigator.js:375 nav/class/Navigator.js:378 |
667 | -#: nav/class/Navigator.js:381 |
668 | +#: nav/class/Navigator.js:381 nav/class/Navigator.js:384 |
669 | +#: nav/class/Navigator.js:387 |
670 | msgid "Enter the roundabout and take the exit %1" |
671 | msgstr "" |
672 | |
673 | -#: nav/class/Navigator.js:384 |
674 | +#: nav/class/Navigator.js:390 |
675 | msgid "Exit the roundabout" |
676 | msgstr "" |
677 | |
678 | -#: nav/class/Navigator.js:387 nav/class/Navigator.js:390 |
679 | #: nav/class/Navigator.js:393 nav/class/Navigator.js:396 |
680 | #: nav/class/Navigator.js:399 nav/class/Navigator.js:402 |
681 | #: nav/class/Navigator.js:405 nav/class/Navigator.js:408 |
682 | -#: nav/class/Navigator.js:411 |
683 | +#: nav/class/Navigator.js:411 nav/class/Navigator.js:414 |
684 | +#: nav/class/Navigator.js:417 |
685 | msgid "Take the exit %1" |
686 | msgstr "" |
687 | |
688 | -#: nav/class/Navigator.js:414 |
689 | +#: nav/class/Navigator.js:420 |
690 | msgid "Take the Ferry" |
691 | msgstr "" |
692 | |
693 | -#: nav/class/Navigator.js:417 |
694 | +#: nav/class/Navigator.js:423 |
695 | msgid "Leave the Ferry" |
696 | msgstr "" |
697 | |
698 | -#: nav/class/Navigator.js:479 |
699 | +#: nav/class/Navigator.js:488 |
700 | msgid " onto %1" |
701 | msgstr "" |
702 | |
703 | -#: nav/class/Navigator.js:482 |
704 | +#: nav/class/Navigator.js:491 |
705 | msgid ". Exit %1" |
706 | msgstr "" |
707 | |
708 | -#: nav/class/Navigator.js:484 |
709 | +#: nav/class/Navigator.js:493 |
710 | msgid " to take the %1" |
711 | msgstr "" |
712 | |
713 | -#: nav/class/Navigator.js:486 |
714 | +#: nav/class/Navigator.js:495 |
715 | msgid " toward %1" |
716 | msgstr "" |
717 | |
718 | -#: nav/class/Navigator.js:488 |
719 | +#: nav/class/Navigator.js:497 |
720 | msgid ", %1" |
721 | msgstr "" |
722 | |
723 | @@ -1188,39 +1188,39 @@ |
724 | msgid "Current End" |
725 | msgstr "" |
726 | |
727 | -#: nav/class/UI.js:412 |
728 | +#: nav/class/UI.js:439 |
729 | msgid "Waiting for a GPS signal…" |
730 | msgstr "" |
731 | |
732 | -#: nav/class/UI.js:419 |
733 | +#: nav/class/UI.js:446 |
734 | msgid "Searching for a route…" |
735 | msgstr "" |
736 | |
737 | -#: nav/class/UI.js:423 |
738 | +#: nav/class/UI.js:450 |
739 | msgid "Drawing route…" |
740 | msgstr "" |
741 | |
742 | -#: nav/class/UI.js:427 |
743 | +#: nav/class/UI.js:454 |
744 | msgid "Trying search again soon…" |
745 | msgstr "" |
746 | |
747 | -#: nav/class/UI.js:431 |
748 | +#: nav/class/UI.js:458 |
749 | msgid "Recalculating route…" |
750 | msgstr "" |
751 | |
752 | -#: nav/class/UI.js:452 |
753 | +#: nav/class/UI.js:479 |
754 | msgid "Navigation will start soon" |
755 | msgstr "" |
756 | |
757 | -#: nav/class/UI.js:484 |
758 | +#: nav/class/UI.js:511 |
759 | msgid "Simulating route…" |
760 | msgstr "" |
761 | |
762 | -#: nav/class/UI.js:488 |
763 | +#: nav/class/UI.js:515 |
764 | msgid "Error simulating route. Try different points" |
765 | msgstr "" |
766 | |
767 | -#: nav/class/UI.js:509 |
768 | +#: nav/class/UI.js:536 |
769 | msgid "Click onto the icon for reviewing the route" |
770 | msgstr "" |
771 | |
772 | |
773 | === modified file 'qml/AboutPage.qml' |
774 | --- qml/AboutPage.qml 2016-06-16 10:31:26 +0000 |
775 | +++ qml/AboutPage.qml 2016-08-05 14:42:08 +0000 |
776 | @@ -79,6 +79,7 @@ |
777 | // Powered By |
778 | creditsModel.append({ category: i18n.tr("Powered by"), name: "OpenStreetMap & Contributors", link: "http://www.openstreetmap.org" }) |
779 | creditsModel.append({ category: i18n.tr("Powered by"), name: "Mapzen", link: "https://mapzen.com" }) |
780 | + creditsModel.append({ category: i18n.tr("Powered by"), name: "MapTiles", link: "https://maptiles.xyz" }) |
781 | creditsModel.append({ category: i18n.tr("Powered by"), name: "Stamen", link: "http://stamen.com" }) |
782 | creditsModel.append({ category: i18n.tr("Powered by"), name: "OpenStreetMap Nominatin", link: "http://open.mapquestapi.com/nominatim" }) |
783 | creditsModel.append({ category: i18n.tr("Powered by"), name: "Overpass API", link: "http://wiki.openstreetmap.org/wiki/Overpass_API/XAPI_Compatibility_Layer" }) |
784 | |
785 | === modified file 'qml/Main.qml' |
786 | --- qml/Main.qml 2016-08-05 14:42:08 +0000 |
787 | +++ qml/Main.qml 2016-08-05 14:42:08 +0000 |
788 | @@ -61,7 +61,7 @@ |
789 | |
790 | property string applicationVersion: "0.62" |
791 | property string mapUrl: "../nav/index.html" |
792 | - property string appUA: "Mozilla/5.0 (Linux; Android 5.0; Nexus 5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.102 Mobile Safari/537.36" |
793 | + property string appUA: "Mozilla/5.0 (Linux; Android 5.0; Nexus 5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.102 Mobile Safari/537.36 Project uNav" |
794 | |
795 | // persistent app settings: |
796 | property var settings: Settings { |
797 | @@ -72,6 +72,7 @@ |
798 | property int routingMode: 0 // 0 car, 1 walk, 2 bicycle |
799 | property bool avoidTolls: false |
800 | property bool alertRadars: false |
801 | + property bool verboseIndications: false |
802 | property bool legalRadarShow: true |
803 | property string prevLat: '' |
804 | property string prevLng: '' |
805 | @@ -419,24 +420,22 @@ |
806 | if (!loading && !mainPageStack.onLoadingExecuted) { |
807 | mainPageStack.onLoadingExecuted = true; |
808 | //send saved Setting states: |
809 | - mainPageStack.executeJavaScript("settings.set_sound(" + navApp.settings.soundIndications + ");"); |
810 | - |
811 | - if (!navApp.settings.layer) { |
812 | - mainPageStack.executeJavaScript("ui.set_map_layer(" + navApp.settings.onlineLayer + ");"); |
813 | - } else |
814 | - mainPageStack.executeJavaScript("ui.set_map_layer(3);") |
815 | - |
816 | - mainPageStack.executeJavaScript("settings.set_unit(\'" + ( navApp.settings.unit === 0 ? "km" : "mi" ) +"\');"); |
817 | - mainPageStack.executeJavaScript("ui.set_scale_unit(\'" + ( navApp.settings.unit === 0 ? "km" : "mi" ) +"\');"); |
818 | - mainPageStack.executeJavaScript("settings.set_routing_mode(" + navApp.settings.routingMode + ");"); |
819 | - mainPageStack.executeJavaScript("settings.set_avoid_tolls(" + navApp.settings.avoidTolls + ");"); |
820 | - mainPageStack.executeJavaScript("settings.set_alert_radars(" + navApp.settings.alertRadars + ");"); |
821 | - mainPageStack.executeJavaScript("settings.set_ui_speed(" + navApp.settings.uiShowSpeed + ");"); |
822 | - |
823 | + mainPageStack.executeJavaScript("settings.set_sound(" + navApp.settings.soundIndications + ")"); |
824 | + mainPageStack.executeJavaScript("settings.set_unit(\'" + ( navApp.settings.unit === 0 ? "km" : "mi" ) +"\')"); |
825 | + mainPageStack.executeJavaScript("ui.set_scale_unit(\'" + ( navApp.settings.unit === 0 ? "km" : "mi" ) +"\')"); |
826 | + mainPageStack.executeJavaScript("settings.set_routing_mode(" + navApp.settings.routingMode + ")"); |
827 | + mainPageStack.executeJavaScript("nav.set_verbose_indications(" + navApp.settings.verboseIndications + ")"); |
828 | + mainPageStack.executeJavaScript("settings.set_avoid_tolls(" + navApp.settings.avoidTolls + ")"); |
829 | + mainPageStack.executeJavaScript("settings.set_alert_radars(" + navApp.settings.alertRadars + ")"); |
830 | + mainPageStack.executeJavaScript("settings.set_ui_speed(" + navApp.settings.uiShowSpeed + ")"); |
831 | // Center map in last position |
832 | - if (navApp.settings.prevLat !== '' && navApp.settings.prevLng !== '' && navApp.settings.prevLat !== null && navApp.settings.prevLng !== null && navApp.settings.prevZoom !== 9999) { |
833 | - mainPageStack.executeJavaScript("map.getView().setCenter(ol.proj.transform([" + navApp.settings.prevLng + "," + navApp.settings.prevLat + "], 'EPSG:4326', 'EPSG:3857')); map.getView().setZoom(" + navApp.settings.prevZoom + ");"); |
834 | - } |
835 | + if (navApp.settings.prevLat !== '' && navApp.settings.prevLng !== '' && navApp.settings.prevLat !== null && navApp.settings.prevLng !== null && navApp.settings.prevZoom !== 9999) |
836 | + mainPageStack.executeJavaScript("map.getView().setCenter(ol.proj.transform([" + navApp.settings.prevLng + "," + navApp.settings.prevLat + "], 'EPSG:4326', 'EPSG:3857')); map.getView().setZoom(" + navApp.settings.prevZoom + ")"); |
837 | + // This always after previous instruction! |
838 | + if (!navApp.settings.layer) |
839 | + mainPageStack.executeJavaScript("ui.set_map_layer(" + navApp.settings.onlineLayer + ")"); |
840 | + else |
841 | + mainPageStack.executeJavaScript("ui.set_map_layer(99)") |
842 | |
843 | // Hack: If user click so fast in buttons, app breaks sometimes |
844 | navigationPage.buttonsEnabled = true; |
845 | |
846 | === modified file 'qml/SettingsPage.qml' |
847 | --- qml/SettingsPage.qml 2016-08-05 14:42:08 +0000 |
848 | +++ qml/SettingsPage.qml 2016-08-05 14:42:08 +0000 |
849 | @@ -88,9 +88,11 @@ |
850 | id: onlineLayerModel |
851 | Component.onCompleted: initialize() |
852 | function initialize() { |
853 | - onlineLayerModel.append({ "onlineLayer": "OpenStreetMap", "index": 0 }) |
854 | - onlineLayerModel.append({ "onlineLayer": i18n.tr("Terrain"), "index": 1 }) |
855 | - onlineLayerModel.append({ "onlineLayer": i18n.tr("Topo (Hiking)"), "index": 2 }) |
856 | + onlineLayerModel.append({ "onlineLayer": "OpenStreetMap", "index": 0 }) |
857 | + onlineLayerModel.append({ "onlineLayer": "Stamen Terrain", "index": 1 }) |
858 | + onlineLayerModel.append({ "onlineLayer": "Stamen Toner Lite", "index": 2 }) |
859 | + onlineLayerModel.append({ "onlineLayer": "OpenTopoMap", "index": 3 }) |
860 | + onlineLayerModel.append({ "onlineLayer": "Mapbox", "index": 4 }) |
861 | |
862 | onlineLayerList.subText.text = onlineLayerModel.get(navApp.settings.onlineLayer).onlineLayer |
863 | } |
864 | @@ -160,6 +162,23 @@ |
865 | } |
866 | |
867 | ListItem { |
868 | + height: verboseIndLayout.height + divider.height |
869 | + ListItemLayout { |
870 | + id: verboseIndLayout |
871 | + title.text: i18n.tr("Verbose Indications") |
872 | + Switch { |
873 | + id: verboseIndSwitch |
874 | + checked: navApp.settings.verboseIndications |
875 | + onClicked: { |
876 | + navApp.settings.verboseIndications = checked; |
877 | + mainPageStack.executeJavaScript("if (nav.get_route_status() != 'no'){nav.set_route_status('waiting4signal')}; nav.set_verbose_indications(" + checked.toString() + ");") |
878 | + } |
879 | + SlotsLayout.position: SlotsLayout.Last |
880 | + } |
881 | + } |
882 | + } |
883 | + |
884 | + ListItem { |
885 | visible: navApp.settings.routingMode === 0 |
886 | height: tollsLayout.height + divider.height |
887 | ListItemLayout { |
888 | @@ -240,7 +259,7 @@ |
889 | ExpandableListItem { |
890 | id: layerList |
891 | height: howToMapsLabel.visible ? listViewHeight + units.gu(0.5) : listViewHeight |
892 | - listViewHeight: units.gu(8+1) |
893 | + listViewHeight: units.gu(9+1) |
894 | titleText.text: i18n.tr("Mode") |
895 | |
896 | model: layerModel |
897 | @@ -267,7 +286,7 @@ |
898 | mainPageStack.executeJavaScript("ui.set_map_layer(" + navApp.settings.onlineLayer + ")") |
899 | } |
900 | else { |
901 | - mainPageStack.executeJavaScript("ui.set_map_layer(3);") //3 == offline |
902 | + mainPageStack.executeJavaScript("ui.set_map_layer(99)") // Independent of number of layers |
903 | } |
904 | layerList.subText.text = layerModel.get(navApp.settings.layer).layer |
905 | layerList.toggleExpansion() |
906 | @@ -292,7 +311,7 @@ |
907 | ExpandableListItem { |
908 | id: onlineLayerList |
909 | |
910 | - listViewHeight: units.gu(12+1) |
911 | + listViewHeight: units.gu(21+1) |
912 | titleText.text: i18n.tr("Online Style") |
913 | |
914 | model: onlineLayerModel |