~costales/unav/0.60-recalc-route-from-out

« back to all changes in this revision

Viewing changes to nav/class/UI.js

  • Committer: costales
  • Author(s): Marcos Costales
  • Date: 2016-06-15 17:26:44 UTC
  • mfrom: (55.7.58 0.60-simple-code)
  • Revision ID: costales.marcos@gmail.com-20160615172644-efmn602rqd5i8ygh
Added calculating route status because 'searching' flag is n...
Rework error web API
Rework no confirm route
No donation btn
Bug 1/15 pos doesn't exits anymore
Recalculate if API error
i18n updated
Message looking for position when user clicks center
Remove decimals from lat,lng in another way. If not, the coo...
Large font for info msg and hide if click fast on map
Msgs for more intuitive simulation process
Added log for check denied
Removed check accuracy
No maximumAge (testing purpose)
Securize all GPS data
Allow double click for zooming
Allow wheel mouse for zooming (check this on phone)
Redefine distance for zoom near
Speak voice before high zoom
Removed timer auto confirm route in X seconds
Remove timer for gps died
Max zoom 19
BG image for map

Show diffs side-by-side

added added

removed removed

Lines of Context:
101
101
        
102
102
        this.scaleline = new ol.control.ScaleLine();
103
103
        this.map.addControl(this.scaleline);
104
 
        
105
 
        // Disable zoom events: Bug https://goo.gl/hxDwa3
106
 
        var interactions = this.map.getInteractions().getArray();
107
 
        var inte1 = interactions.filter(function(interaction) {
108
 
          return interaction instanceof ol.interaction.DoubleClickZoom;
109
 
        })[0];
110
 
        var inte2 = interactions.filter(function(interaction) {
111
 
          return interaction instanceof ol.interaction.MouseWheelZoom;
112
 
        })[0];
113
 
        inte1.setActive(false);
114
 
        inte2.setActive(false);
115
104
}
116
105
 
117
106
UI.prototype.ZOOM_CITY = 17;
118
107
UI.prototype.ZOOM_HIGHWAY = 16;
119
108
UI.prototype.ZOOM_POI = 17;
120
 
UI.prototype.LONG_TRACK_HIGHWAY = 2000;
 
109
UI.prototype.LONG_TRACK_HIGHWAY = 850;
121
110
UI.prototype.DIST4ROTATION = 3;
122
111
UI.prototype.SPEED4ROTATION = 5;
123
112
UI.prototype.COLOR_ORANGE = '#DD4814';
271
260
                this.map.getView().setZoom(this.ZOOM_CITY); // City
272
261
        }
273
262
        else {
274
 
                if (!radar && dist2turn > this.LONG_TRACK_HIGHWAY && dist_track_done > (this.LONG_TRACK_HIGHWAY/3))
 
263
                if (!radar && dist2turn > this.LONG_TRACK_HIGHWAY && dist_track_done > this.LONG_TRACK_HIGHWAY)
275
264
                        this.map.getView().setZoom(this.ZOOM_HIGHWAY - 3); // Highway special zoom
276
265
                else
277
266
                        this.map.getView().setZoom(this.ZOOM_HIGHWAY); // Highway
387
376
                        break;
388
377
                case 'calc':
389
378
                case 'calc_from_out':
 
379
                case 'calculating':
390
380
                        $('#p_msg').html(t("Searching for a route…"));
391
381
                        $('#panel_msg').show();
392
382
                        break;
395
385
                        $('#panel_msg').show();
396
386
                        break;
397
387
                case 'errorAPI':
398
 
                        $('#p_msg').html(t("Error finding route between points. Check the connection and try again"));
 
388
                        $('#p_msg').html(t("Trying search again soon…"));
399
389
                        $('#panel_msg').show();
400
390
                        break;
401
391
                case 'out':
502
492
        }
503
493
}
504
494
 
505
 
UI.prototype.KO_API_radars = function() {
506
 
        qml_show_notification('warning', 'speed_camera_error')
507
 
}
508
 
 
509
495
UI.prototype.map_height = function() {
510
496
        // car + route = car on bottom
511
 
        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')) {
 
497
        if (this.map_stretched && this.settings.get_routing_mode() != 1 && this.nav.get_route_status() == 'yes') {
512
498
                var aux_height = 0;
513
499
                if ($('#panel_summary').is(':visible'))
514
500
                        aux_height = aux_height + $('#panel_summary').height();
577
563
                case 'drawing':
578
564
                case 'calc':
579
565
                case 'calc_from_out':
 
566
                case 'calculating':
580
567
                case 'out':
581
568
                        if (speed > this.SPEED4ROTATION) {
582
569
                                var dist = geolib.getDistance(