From 3c2a5c249d2a0cec1d5c371efcd1dfcf7e8c7f2e Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Fri, 18 Aug 2017 11:22:48 +1200 Subject: Fix various style issues --- web/app/view/map/BaseMap.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'web/app/view/map/BaseMap.js') diff --git a/web/app/view/map/BaseMap.js b/web/app/view/map/BaseMap.js index c4297f6..5829cac 100644 --- a/web/app/view/map/BaseMap.js +++ b/web/app/view/map/BaseMap.js @@ -95,10 +95,10 @@ Ext.define('Traccar.view.map.BaseMap', { index = index < 0 ? index + urlsLength : index; if (x < 0) { - x = 'M' + (-x); + x = 'M' + -x; } if (y < 0) { - y = 'M' + (-y); + y = 'M' + -y; } return 'http://online{}.map.bdimg.com/onlinelabel/?qt=tile&x={x}&y={y}&z={z}&styles=pl' .replace('{}', index).replace('{x}', x).replace('{y}', y).replace('{z}', z); @@ -171,7 +171,7 @@ Ext.define('Traccar.view.map.BaseMap', { } this.map.on('pointermove', function (e) { - var hit = this.forEachFeatureAtPixel(e.pixel, function (feature, layer) { + var hit = this.forEachFeatureAtPixel(e.pixel, function () { return true; }); if (hit) { @@ -187,7 +187,7 @@ Ext.define('Traccar.view.map.BaseMap', { return !layer.get('name'); } })) { - this.map.forEachFeatureAtPixel(e.pixel, function (feature, layer) { + this.map.forEachFeatureAtPixel(e.pixel, function (feature) { this.fireEvent('selectfeature', feature); }.bind(this)); } else { @@ -206,9 +206,7 @@ Ext.define('Traccar.view.map.BaseMap', { } } }, function () { - proj4.defs('BD-MC', '+proj=merc +lon_0=0 +units=m +ellps=clrk66 +no_defs'); proj4.defs('EPSG:3395', '+proj=merc +lon_0=0 +k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs'); ol.proj.get('EPSG:3395').setExtent([-20037508.342789244, -20037508.342789244, 20037508.342789244, 20037508.342789244]); - }); -- cgit v1.2.3 From a2f24e445ef4c4c06a754b4538d51aec38e1dcbf Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Fri, 18 Aug 2017 13:53:13 +0500 Subject: Update openlayers to 4.3.1 --- web/app/view/map/BaseMap.js | 11 ++++++----- web/load.js | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'web/app/view/map/BaseMap.js') diff --git a/web/app/view/map/BaseMap.js b/web/app/view/map/BaseMap.js index 5829cac..91f3784 100644 --- a/web/app/view/map/BaseMap.js +++ b/web/app/view/map/BaseMap.js @@ -182,14 +182,15 @@ Ext.define('Traccar.view.map.BaseMap', { }); this.map.on('click', function (e) { - if (this.map.hasFeatureAtPixel(e.pixel, { + var i, features = this.map.getFeaturesAtPixel(e.pixel, { layerFilter: function (layer) { return !layer.get('name'); } - })) { - this.map.forEachFeatureAtPixel(e.pixel, function (feature) { - this.fireEvent('selectfeature', feature); - }.bind(this)); + }); + if (features) { + for (i = 0; i < features.length; i++) { + this.fireEvent('selectfeature', features[i]); + } } else { this.fireEvent('deselectfeature'); } diff --git a/web/load.js b/web/load.js index 1845cd1..8577280 100644 --- a/web/load.js +++ b/web/load.js @@ -136,7 +136,7 @@ extjsVersion = '6.2.0'; fontAwesomeVersion = '4.7.0'; - olVersion = '4.2.0'; + olVersion = '4.3.1'; proj4jsVersion = '2.4.3'; if (debugMode) { -- cgit v1.2.3