2
* uNav http://launchpad.net/unav
3
* Copyright (C) 2015-2016 Marcos Alvarez Costales https://launchpad.net/~costales
5
* uNav is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation; either version 2 of the License, or
8
* (at your option) any later version.
10
* uNav is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
16
function UI(map, nav, settings, maths, lang) {
19
this.settings = settings;
23
this.pos_prev = new Object();
24
this.pos_prev['lat'] = null;
25
this.pos_prev['lng'] = null;
27
this.center_onpos = true;
28
this.center_1st_pos = true;
29
this.zoom_unav = true;
30
this.map_stretched = true;
32
this.marker_pos = new ol.Overlay({
33
positioning: 'center-center',
34
element: document.getElementById('marker_pos')
36
this.map.addOverlay(this.marker_pos);
37
$('#marker_pos').click(function () {
38
window.location = 'http://clicked_on_map?' + nav.get_pos_data()['now_lat'] + '/' + nav.get_pos_data()['now_lng'] + '/' + t("Current Position") + '/none/none/follow';
41
this.marker_start = new ol.Overlay({
42
positioning: 'bottom-center',
43
element: document.getElementById('marker_pos_start')
45
this.map.addOverlay(this.marker_start);
46
$('#marker_pos_start').click(function () {
47
window.location = 'http://clicked_on_map?' + nav.get_pos_data()['start_lat'] + '/' + nav.get_pos_data()['start_lng'] + '/' + t("Current Start") + '/none/none/nofollow';
50
this.marker_end = new ol.Overlay({
51
positioning: 'bottom-center',
52
element: document.getElementById('marker_pos_end')
54
this.map.addOverlay(this.marker_end);
55
$('#marker_pos_end').click(function () {
56
window.location = 'http://clicked_on_map?' + nav.get_pos_data()['end_lat'] + '/' + nav.get_pos_data()['end_lng'] + '/' + t("Current End") + '/none/none/nofollow';
59
this.markers_POI = [];
60
for (i=0 ; i<50; i++) {
61
var POI = new ol.Overlay({
62
positioning: 'bottom-center',
63
element: document.getElementById('POI'+i)
65
this.markers_POI.push(POI);
66
this.map.addOverlay(this.markers_POI[i]);
68
this.map_pois_extend = new ol.source.Vector({});
70
this.markers_radar = [];
71
for (i=0 ; i<100; i++) {
72
var radar = new ol.Overlay({
73
positioning: 'bottom-center',
74
element: document.getElementById('radar'+i)
76
this.markers_radar.push(radar);
77
this.map.addOverlay(this.markers_radar[i]);
80
this.routeSource = new ol.source.Vector({});
81
route_line = new ol.layer.Vector({
82
source: this.routeSource,
85
stroke: new ol.style.Stroke({
91
stroke: new ol.style.Stroke({
98
this.map.addLayer(route_line);
100
this.scaleline = new ol.control.ScaleLine();
101
this.map.addControl(this.scaleline);
103
// Disable zoom events: Bug https://goo.gl/hxDwa3
104
var interactions = this.map.getInteractions().getArray();
105
var inte1 = interactions.filter(function(interaction) {
106
return interaction instanceof ol.interaction.DoubleClickZoom;
108
var inte2 = interactions.filter(function(interaction) {
109
return interaction instanceof ol.interaction.PinchZoom;
111
var inte3 = interactions.filter(function(interaction) {
112
return interaction instanceof ol.interaction.MouseWheelZoom;
114
inte1.setActive(false);
115
inte2.setActive(false);
116
inte3.setActive(false);
119
UI.prototype.ZOOM_CITY = 18;
120
UI.prototype.ZOOM_HIGHWAY = 16;
121
UI.prototype.ZOOM_POI = 17;
122
UI.prototype.LONG_TRACK_HIGHWAY = 2000;
123
UI.prototype.LONG_TRACK_CITY = 500;
124
UI.prototype.DIST4ROTATION = 3;
125
UI.prototype.SPEED4ROTATION = 5;
126
UI.prototype.COLOR_ORANGE = '#DD4814';
127
UI.prototype.COLOR_PURPLE = '#2C001E';
130
UI.prototype.set_map_stretched = function(status) {
131
this.map_stretched = status;
134
UI.prototype.set_center_onpos = function(status) {
135
this.center_onpos = status;
138
UI.prototype.get_center_onpos = function() {
139
return this.center_onpos;
142
UI.prototype.set_center_1st_pos = function(status) {
143
this.center_1st_pos = status;
146
UI.prototype.set_zoom_unav = function(zoom) {
147
this.zoom_unav = zoom;
150
UI.prototype.markers = function(start_lat, start_lng, end_lat, end_lng) {
151
this.marker_start.setPosition(undefined);
152
this.marker_end.setPosition(undefined);
154
if (this.nav.get_route_status() == '2review' || this.nav.get_route_status() == 'yes' || this.nav.get_route_status() == 'out' || this.nav.get_route_status() == 'ended' || this.nav.get_route_status().startsWith('simulate_done')) {
155
if (start_lat != null && start_lng != null)
156
this.marker_start.setPosition(ol.proj.transform([start_lng, start_lat], 'EPSG:4326', 'EPSG:3857'));
159
if (end_lat != null && end_lng != null)
160
this.marker_end.setPosition(ol.proj.transform([end_lng, end_lat], 'EPSG:4326', 'EPSG:3857'));
163
UI.prototype.route = function(redraw_map) {
164
if (this.nav.get_route_status() !== 'drawing' && this.nav.get_route_status() !== 'simulate_drawing') {
165
this.routeSource.clear();
169
this.map.getView().setRotation(0);
171
this.routeSource.clear();
173
var lineString = new ol.geom.LineString(this.nav.get_route_line_map());
174
lineString.transform('EPSG:4326', 'EPSG:3857');
175
var routepoints = new ol.Feature({
178
this.routeSource.addFeature(routepoints);
182
var pan = ol.animation.pan({duration: 600, source: map.getView().getCenter()});
183
var zoom = ol.animation.zoom({duration: 600, resolution: map.getView().getResolution()});
184
this.map.beforeRender(pan, zoom);
187
if ($('#panel_review_btns').is(':visible'))
188
aux_height = aux_height + $('#panel_review_btns').height();
189
if ($('#panel_review_summary').is(':visible'))
190
aux_height = aux_height + $('#panel_review_summary').height();
191
if ($('#panel_summary').is(':visible'))
192
aux_height = aux_height + $('#panel_summary').height();
193
if ($('#panel_txt_ind').is(':visible'))
194
aux_height = aux_height + $('#panel_txt_ind').height();
195
if ($('#panel_msg').is(':visible'))
196
aux_height = aux_height + $('#panel_msg').height();
197
aux_height = aux_height + 50;
198
this.map.getView().fit(this.routeSource.getExtent(), this.map.getSize(), {padding: [80, 25, aux_height, 25]});
202
UI.prototype.pos = function(lat, lng, accu) {
203
this.marker_pos.setPosition(undefined);
205
if (lat === null || lng === null)
208
switch (this.settings.get_routing_mode()) {
210
$('#marker_pos').attr('src', "img/marker/car.png");
213
$('#marker_pos').attr('src', "img/marker/walk.png");
216
$('#marker_pos').attr('src', "img/marker/bike.png");
220
this.marker_pos.setPosition(ol.proj.transform([lng, lat], 'EPSG:4326', 'EPSG:3857'));
222
if (accu <= this.nav.ACCU4DRIVE)
223
$('#marker_pos').css('opacity', '1.0');
224
else if (accu <= this.nav.ACCU4DRIVE * 2)
225
$('#marker_pos').css('opacity', '0.9');
226
else if (accu <= this.nav.ACCU4DRIVE * 4)
227
$('#marker_pos').css('opacity', '0.7');
229
$('#marker_pos').css('opacity', '0.5');
232
UI.prototype.map_center = function(lat, lng) {
233
if (!this.center_onpos)
236
if (lat === null && lng === null)
239
this.map.getView().setCenter(ol.proj.transform([lng, lat], 'EPSG:4326', 'EPSG:3857'));
242
UI.prototype.map_zoom = function(speed, dist2turn, dist_track_done, radar) {
246
if (this.nav.get_route_status() != 'yes') {
247
this.map.getView().setZoom(this.ZOOM_POI); // Looking position = POI
251
if (speed <= this.nav.SPEED_CITY) {
252
if (this.settings.get_routing_mode() != 1 && !radar && dist2turn > this.LONG_TRACK_CITY && dist_track_done > (this.LONG_TRACK_CITY/3))
253
this.map.getView().setZoom(this.ZOOM_CITY - 1); // City special zoom
255
this.map.getView().setZoom(this.ZOOM_CITY); // City
258
if (!radar && dist2turn > this.LONG_TRACK_HIGHWAY && dist_track_done > (this.LONG_TRACK_HIGHWAY/3))
259
this.map.getView().setZoom(this.ZOOM_HIGHWAY - 3); // Highway special zoom
261
this.map.getView().setZoom(this.ZOOM_HIGHWAY); // Highway
265
UI.prototype.markers_POI_clear = function() {
266
for (i=0; i<this.markers_POI.length; i++) {
267
this.markers_POI[i].setPosition(undefined);
268
$('#POI'+i).unbind("click");
272
UI.prototype.markers_POI_set = function(pois) {
277
this.set_center_onpos(false);
278
this.set_center_1st_pos(false);
279
this.set_zoom_unav(false);
280
this.set_map_stretched(false);
284
this.markers_POI_clear();
285
this.map_pois_extend.clear();
287
for (i=0; i<pois.length; i++) {
288
// More POIs than expected?
289
if (i>=this.markers_POI.length)
293
this.markers_POI[i].setPosition(ol.proj.transform([pois[i].lng, pois[i].lat], 'EPSG:4326', 'EPSG:3857'));
295
// POI Click //to be redefined
298
if (typeof pois[i].website !== 'undefined') {
299
website = pois[i].website.replace(/\//g, ' ');
300
website = website.replace(/\?/g, 'ç');
302
if (typeof pois[i].phone !== 'undefined')
303
phone = pois[i].phone;
305
$('#POI'+i).bind('click', {title: pois[i].title, lat: pois[i].lat, lng: pois[i].lng, website: website, phone: phone}, function(event) {
306
ui.set_center_onpos(false);
307
ui.set_center_1st_pos(false);
309
map.beforeRender(ol.animation.pan({
311
source: map.getView().getCenter()
313
map.getView().setCenter(ol.proj.transform([event.data.lng, event.data.lat], 'EPSG:4326', 'EPSG:3857'));
315
window.location = 'http://clicked_on_map?' + event.data.lat + '/' + event.data.lng + '/' + event.data.title + '/' + event.data.website + '/' + event.data.phone + '/nofollow';
319
var iconFeature = new ol.Feature({
320
geometry: new ol.geom.Point(ol.proj.transform([pois[i].lng, pois[i].lat], 'EPSG:4326', 'EPSG:3857'))
322
this.map_pois_extend.addFeature(iconFeature);
325
// Show PopUp if poi.length = 1
326
var pan = ol.animation.pan({duration: 600, source: map.getView().getCenter()});
327
var zoom = ol.animation.zoom({duration: 600, resolution: map.getView().getResolution()});
328
this.map.beforeRender(pan, zoom);
329
if (pois.length === 1) {
330
this.map.getView().setZoom(this.ZOOM_POI);
331
this.map.getView().setCenter(ol.proj.transform([pois[0].lng, pois[0].lat], 'EPSG:4326', 'EPSG:3857'));
335
if (typeof pois[0].website !== 'undefined') {
336
website = pois[0].website.replace(/\//g, ' ');
337
website = website.replace(/\?/g, 'ç');
339
if (typeof pois[0].phone !== 'undefined')
340
phone = pois[0].phone;
341
window.location = 'http://clicked_on_map?' + pois[0].lat + '/' + pois[0].lng + '/' + pois[0].title + '/' + website + '/' + phone + '/nofollow';
345
if ($('#panel_review_btns').is(':visible'))
346
aux_height = aux_height + $('#panel_review_btns').height();
347
if ($('#panel_review_summary').is(':visible'))
348
aux_height = aux_height + $('#panel_review_summary').height();
349
if ($('#panel_summary').is(':visible'))
350
aux_height = aux_height + $('#panel_summary').height();
351
if ($('#panel_txt_ind').is(':visible'))
352
aux_height = aux_height + $('#panel_txt_ind').height();
353
if ($('#panel_msg').is(':visible'))
354
aux_height = aux_height + $('#panel_msg').height();
355
aux_height = aux_height + 50;
356
this.map.getView().fit(this.map_pois_extend.getExtent(), this.map.getSize(), {padding: [80, 15, aux_height, 15]});
360
UI.prototype.panels = function(route_indicator) {
361
$('#panel_msg, #panel_navigation, #panel_review, #max_speed_alert').hide();
363
switch(this.nav.get_route_status()) {
364
case 'waiting4signal':
365
var gps_data = this.nav.get_pos_data();
366
if (gps_data['accu'] <= this.nav.ACCU4DRIVE) {
367
$('#p_msg').html("<progress value='100' max='100' id='gps_progress'></progress><br>" + t("Waiting for a good GPS signal…"));
368
} else if (gps_data['accu'] <= this.nav.ACCU4DRIVE * 2) {
369
$('#p_msg').html("<progress value='80' max='100' id='gps_progress'></progress><br>" + t("Waiting for a good GPS signal…"));
370
} else if (gps_data['accu'] <= this.nav.ACCU4DRIVE * 4) {
371
$('#p_msg').html("<progress value='60' max='100' id='gps_progress'></progress><br>" + t("Waiting for a good GPS signal…"));
372
} else if (gps_data['accu'] <= this.nav.ACCU4DRIVE * 7) {
373
$('#p_msg').html("<progress value='40' max='100' id='gps_progress'></progress><br>" + t("Waiting for a good GPS signal…"));
374
} else if (gps_data['accu'] <= this.nav.ACCU4DRIVE * 10) {
375
$('#p_msg').html("<progress value='20' max='100' id='gps_progress'></progress><br>" + t("Waiting for a good GPS signal…"));
377
$('#p_msg').html("<progress value='5' max='100' id='gps_progress'></progress><br>" + t("Waiting for a good GPS signal…"));
379
$('#panel_msg').show();
382
case 'calc_from_out':
383
$('#p_msg').html(t("Searching for a route…"));
384
$('#panel_msg').show();
387
$('#p_msg').html(t("Drawing route…"));
388
$('#panel_msg').show();
391
$('#p_msg').html(t("Error finding route between points. Check the connection and try again"));
392
$('#panel_msg').show();
395
$('#p_msg').html(t("Recalculating route…"));
396
$('#panel_msg').show();
399
$('#p_review_time2left').html(this.maths.time2human(route_indicator['time'], false));
400
$('#p_review_total_dist').html(this.maths.dist2human(route_indicator['distance_total'], this.settings.get_unit()));
401
$('#p_review_time2arrive').html(this.maths.time2human(route_indicator['time'], true));
402
$('#panel_review').show();
405
$('#p_time2left').html(this.maths.time2human(route_indicator['time'], false));
406
$('#p_total_dist').html(this.maths.dist2human(route_indicator['distance_total'], this.settings.get_unit()));
407
$('#p_speed').html(this.maths.get_speed(route_indicator['speed'], this.settings.get_unit()));
408
$('#p_time2arrive').html(this.maths.time2human(route_indicator['time'], true));
409
$('#p_img_ind').attr('src', 'img/steps/'+route_indicator['indication']+'.svg');
410
if (route_indicator['indication'] > 3) { // Issue with WIFI, so slow signal
411
$('#p_next_dist').html(this.maths.dist2human(route_indicator['dist2turn'], this.settings.get_unit()));
412
$('#p_txt_ind').html(route_indicator['msg']);
415
$('#p_next_dist').html('');
416
$('#p_txt_ind').html(t("Navigation will start soon"));
418
$('#panel_navigation').show();
419
if (this.settings.get_ui_speed())
420
$('#p_speed').show();
422
$('#p_speed').hide();
424
if (route_indicator['voice'])
425
this.speak(route_indicator['indication']);
427
if (route_indicator['speaked'])
428
$('#panel_indication').css('background-color', this.COLOR_ORANGE);
430
$('#panel_indication, #panel_txt_ind').css('background-color', this.COLOR_PURPLE);
433
if (route_indicator['radar']) {
434
$('#max_speed_alert').show();
435
$('#txt_mapspeed').html(route_indicator['radar_speed']);
436
this.radar_sound(route_indicator['radar_sound']);
440
$('#p_msg').html(t("You have arrived at your destination"));
441
$('#panel_msg').show();
442
if (route_indicator['voice'])
443
this.speak(route_indicator['indication']);
445
case 'simulate_calculating':
446
case 'simulate_drawing':
447
$('#p_msg').html(t("Simulating route…"));
448
$('#panel_msg').show();
450
case 'simulate_error':
451
$('#p_msg').html(t("Error simulating route. Try different points"));
452
$('#panel_msg').show();
454
case 'simulate_done_bike':
455
case 'simulate_done_walk':
456
case 'simulate_done_car':
457
$('#p_time2left').html(this.maths.time2human(route_indicator['time'], false));
458
$('#p_total_dist').html(this.maths.dist2human(route_indicator['distance_total'], this.settings.get_unit()));
459
$('#p_time2arrive').html(this.maths.time2human(route_indicator['time'], true));
460
$('#p_speed').hide();
461
switch (this.nav.get_route_status()) {
462
case 'simulate_done_bike':
463
$('#p_img_ind').attr('src', 'img/mode/bike.svg');
465
case 'simulate_done_walk':
466
$('#p_img_ind').attr('src', 'img/mode/walk.svg');
469
$('#p_img_ind').attr('src', 'img/mode/car.svg');
471
$('#p_next_dist').html('');
472
$('#p_txt_ind').html(t("Click onto the icon for reviewing the route"));
473
$('#panel_navigation').show();
474
$('#panel_indication, #panel_txt_ind').css('background-color', this.COLOR_PURPLE);
479
UI.prototype.scale_line = function() {
480
switch(this.nav.get_route_status()) {
482
$('.ol-scale-line').css({top: 'auto', bottom: '8px'});
485
$('.ol-scale-line').css({top: (window.innerHeight - $('#panel_review_btns').height() - $('#panel_review_summary').height() - 22), bottom: 'auto'});
488
case 'simulate_done_bike':
489
case 'simulate_done_car':
490
case 'simulate_done_walk':
491
$('.ol-scale-line').css({top: (window.innerHeight - $('#panel_summary').height() - $('#panel_txt_ind').height() - 22), bottom: 'auto'});
494
$('.ol-scale-line').css({top: (window.innerHeight - $('#panel_msg').height() - 22), bottom: 'auto'});
498
UI.prototype.KO_API_radars = function() {
499
$('#error_get_radars').show();
500
this.error_API_radars();
501
$('#error_get_radars').delay(8000).fadeOut('slow');
504
UI.prototype.error_API_radars = function() {
505
if (!$('#panel_msg').is(":visible") && !$('#panel_summary').is(":visible") && !$('#panel_review_btns').is(":visible")) {
506
$('#error_get_radars').hide();
510
if ($('#error_get_radars').is(":visible")) {
512
if ($('#panel_review_btns').is(':visible'))
513
aux_height = aux_height + $('#panel_review_btns').height();
514
if ($('#panel_review_summary').is(':visible'))
515
aux_height = aux_height + $('#panel_review_summary').height();
516
if ($('#panel_summary').is(':visible'))
517
aux_height = aux_height + $('#panel_summary').height();
518
if ($('#panel_txt_ind').is(':visible'))
519
aux_height = aux_height + $('#panel_txt_ind').height();
520
if ($('#panel_msg').is(':visible'))
521
aux_height = aux_height + $('#panel_msg').height();
523
$('#error_get_radars').css({bottom: aux_height});
524
$('.ol-scale-line').css({top: (window.innerHeight - aux_height - 22), bottom: 'auto'});
528
UI.prototype.map_height = function() {
529
// car + route = car on bottom
530
if (this.map_stretched && this.settings.get_routing_mode() != 1 && (this.nav.get_route_status() == 'yes' || this.nav.get_route_status() == 'out' || this.nav.get_route_status() == 'calc_from_out')) {
532
if ($('#panel_summary').is(':visible'))
533
aux_height = aux_height + $('#panel_summary').height();
534
if ($('#panel_txt_ind').is(':visible'))
535
aux_height = aux_height + $('#panel_txt_ind').height();
536
if ($('#panel_msg').is(':visible'))
537
aux_height = aux_height + $('#panel_msg').height();
539
$('.map').css({height: ((window.innerHeight * 2) - (aux_height * 2) - 120)});
542
$('.map').css({height: '100%'});
545
this.map.updateSize(); // Hack: Force reload map
548
if (this.nav.get_route_status() != 'no')
549
$('#map_attribution').css({"margin-top": "-40px"});
551
$('#map_attribution').css({"margin-top": "auto"});
555
UI.prototype.radar_sound = function(play) {
556
if (play && this.settings.get_sound() !== 2)
557
$('#radar_sound_alert').trigger('play');
560
UI.prototype.markers_radar_clear = function() {
561
for (i=0; i<this.markers_radar.length; i++) {
562
this.markers_radar[i].setPosition(undefined);
563
$('#radar'+i).unbind("click");
567
UI.prototype.markers_radar_set = function(radars) {
568
if (this.nav.get_route_status() == 'no' || this.nav.get_route_status() == 'errorAPI')
571
// Not show speed cameras position for France users. +info: http://goo.gl/ulXvG8
572
if (this.lang.toLowerCase() == 'fr' || this.lang.toLowerCase() == 'br')
575
for (i=0; i<radars.length; i++) {
576
// More radars than expected?
577
if (i>=this.markers_radar.length)
580
this.markers_radar[i].setPosition(ol.proj.transform([radars[i]['lng'], radars[i]['lat']], 'EPSG:4326', 'EPSG:3857'));
584
UI.prototype.map_rotation = function(status_route, speed, prev_lat, prev_lng, now_lat, now_lng) {
585
if (!this.center_onpos || prev_lat === null || prev_lng === null)
587
if (this.center_onpos && this.settings.get_routing_mode() == 1) {
588
this.map.getView().setRotation(0);
592
switch(status_route) {
598
case 'calc_from_out':
600
if (speed > this.SPEED4ROTATION) {
601
var dist = geolib.getDistance(
602
{latitude: prev_lat, longitude: prev_lng},
603
{latitude: now_lat, longitude: now_lng}
605
if (dist >= this.DIST4ROTATION) { // Only if there is an enough distance for calculate
606
var angle = this.maths.get_angle(prev_lat, prev_lng, now_lat, now_lng);
607
this.map.getView().setRotation(angle);
612
this.map.getView().setRotation(0);
617
UI.prototype.speak = function(indication) {
618
switch (this.settings.get_sound()) {
620
if (indication == 27 || (indication >= 271 && indication <= 274) || indication <= 3) // Not start or exit roundabouts
622
if (indication == 5 || indication == 6) // Same voice
624
$('#'+indication).trigger('play');
627
$('#voice_notif').trigger('play');
632
UI.prototype.set_scale_unit = function(unit) {
634
this.scaleline.setUnits('metric');
636
this.scaleline.setUnits('imperial');
639
UI.prototype.update = function() {
640
var gps_data = this.nav.get_pos_data();
641
var route_indicator = this.nav.get_route_indication();
643
this.markers(gps_data['start_lat'], gps_data['start_lng'], gps_data['end_lat'], gps_data['end_lng']);
645
this.panels(route_indicator);
646
this.error_API_radars();
650
if (!gps_data['gps_is_OK'])
653
this.pos(gps_data['now_lat'], gps_data['now_lng'], gps_data['accu']);
655
if (this.center_1st_pos) {
656
this.center_1st_pos = false;
657
this.center_onpos = true;
658
this.zoom_unav = true;
660
var rotate = ol.animation.rotate({duration: 600, rotation: map.getView().getRotation(), easing: ol.easing.linear});
661
var pan = ol.animation.pan({duration: 600, source: map.getView().getCenter()});
662
var zoom = ol.animation.zoom({duration: 600, resolution: map.getView().getResolution()});
663
this.map.beforeRender(pan, zoom, rotate);
667
this.map_rotation(this.nav.get_route_status(), gps_data['speed'], this.pos_prev['lat'], this.pos_prev['lng'], gps_data['now_lat'], gps_data['now_lng']);
668
this.map_center(gps_data['now_lat'], gps_data['now_lng']);
669
this.map_zoom(gps_data['speed'], route_indicator['dist2turn'], route_indicator['dist_track_done'], route_indicator['radar']);
671
this.pos_prev['lat'] = gps_data['now_lat'];
672
this.pos_prev['lng'] = gps_data['now_lng'];