aboutsummaryrefslogtreecommitdiff
path: root/web/app/view/map
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2017-08-18 11:52:06 +0500
committerAbyss777 <abyss@fox5.ru>2017-08-18 11:52:06 +0500
commit65116928b2b7a8e5e2b70bf490b3225896cf2c71 (patch)
treeaf24b231822fb045a7ae4d03e533775285d41e47 /web/app/view/map
parent01af5f520e24a33d7e22523d8ed11e9f14a19516 (diff)
parentb3d3c720f34e12e7af83e6be3bd87e304931bbe1 (diff)
downloadtrackermap-web-65116928b2b7a8e5e2b70bf490b3225896cf2c71.tar.gz
trackermap-web-65116928b2b7a8e5e2b70bf490b3225896cf2c71.tar.bz2
trackermap-web-65116928b2b7a8e5e2b70bf490b3225896cf2c71.zip
Merge branch 'master' into disable_vehicle_features
Diffstat (limited to 'web/app/view/map')
-rw-r--r--web/app/view/map/BaseMap.js10
-rw-r--r--web/app/view/map/MapController.js8
-rw-r--r--web/app/view/map/MapMarkerController.js28
3 files changed, 19 insertions, 27 deletions
diff --git a/web/app/view/map/BaseMap.js b/web/app/view/map/BaseMap.js
index c4297f68..5829cac9 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]);
-
});
diff --git a/web/app/view/map/MapController.js b/web/app/view/map/MapController.js
index 651bd9f0..d8d2249d 100644
--- a/web/app/view/map/MapController.js
+++ b/web/app/view/map/MapController.js
@@ -79,10 +79,10 @@ Ext.define('Traccar.view.map.MapController', {
this.getView().getGeofencesSource().clear();
if (this.lookupReference('showGeofencesButton').pressed) {
Ext.getStore('Geofences').each(function (geofence) {
- var feature = new ol.Feature(Traccar.GeofenceConverter
- .wktToGeometry(this.getView().getMapView(), geofence.get('area')));
- feature.setStyle(this.getAreaStyle(geofence.get('name'),
- geofence.get('attributes') ? geofence.get('attributes').color : null));
+ var feature = new ol.Feature(
+ Traccar.GeofenceConverter.wktToGeometry(this.getView().getMapView(), geofence.get('area')));
+ feature.setStyle(this.getAreaStyle(
+ geofence.get('name'), geofence.get('attributes') ? geofence.get('attributes').color : null));
this.getView().getGeofencesSource().addFeature(feature);
return true;
}, this);
diff --git a/web/app/view/map/MapMarkerController.js b/web/app/view/map/MapMarkerController.js
index 24742ff9..d3b813b2 100644
--- a/web/app/view/map/MapMarkerController.js
+++ b/web/app/view/map/MapMarkerController.js
@@ -211,7 +211,7 @@ Ext.define('Traccar.view.map.MapMarkerController', {
projection = mapView.getProjection();
center = ol.proj.fromLonLat([position.get('longitude'), position.get('latitude')]);
pointResolution = ol.proj.getPointResolution(projection, mapView.getResolution(), center);
- radius = (position.get('accuracy') / ol.proj.METERS_PER_UNIT.m) * mapView.getResolution() / pointResolution;
+ radius = position.get('accuracy') / ol.proj.METERS_PER_UNIT.m * mapView.getResolution() / pointResolution;
if (feature) {
feature.getGeometry().setCenter(center);
@@ -252,8 +252,8 @@ Ext.define('Traccar.view.map.MapMarkerController', {
marker.set('record', device);
style = this.getLatestMarker(this.getDeviceColor(device),
- position.get('course'),
- device.get('category'));
+ position.get('course'),
+ device.get('category'));
style.getText().setText(device.get('name'));
marker.setStyle(style);
marker.setId(device.get('id'));
@@ -405,7 +405,7 @@ Ext.define('Traccar.view.map.MapMarkerController', {
width: Traccar.Style.mapTextStrokeWidth
}),
offsetY: -image.getSize()[1] / 2 - Traccar.Style.mapTextOffset,
- font : Traccar.Style.mapTextFont
+ font: Traccar.Style.mapTextFont
})
});
},
@@ -420,10 +420,8 @@ Ext.define('Traccar.view.map.MapMarkerController', {
resizeMarker: function (style, zoom) {
var image, text;
- image = Traccar.DeviceImages.getImageIcon(style.getImage().fill,
- zoom,
- style.getImage().angle,
- style.getImage().category);
+ image = Traccar.DeviceImages.getImageIcon(
+ style.getImage().fill, zoom, style.getImage().angle, style.getImage().category);
text = style.getText();
text.setOffsetY(-image.getSize()[1] / 2 - Traccar.Style.mapTextOffset);
style.setText(text);
@@ -431,18 +429,14 @@ Ext.define('Traccar.view.map.MapMarkerController', {
},
rotateMarker: function (style, angle) {
- style.setImage(Traccar.DeviceImages.getImageIcon(style.getImage().fill,
- style.getImage().zoom,
- angle,
- style.getImage().category));
+ style.setImage(Traccar.DeviceImages.getImageIcon(
+ style.getImage().fill, style.getImage().zoom, angle, style.getImage().category));
},
updateDeviceMarker: function (style, color, category) {
var image, text;
- image = Traccar.DeviceImages.getImageIcon(color,
- style.getImage().zoom,
- style.getImage().angle,
- category);
+ image = Traccar.DeviceImages.getImageIcon(
+ color, style.getImage().zoom, style.getImage().angle, category);
text = style.getText();
text.setOffsetY(-image.getSize()[1] / 2 - Traccar.Style.mapTextOffset);
style.setText(text);
@@ -599,7 +593,7 @@ Ext.define('Traccar.view.map.MapMarkerController', {
}
},
- filterDevices: function (store) {
+ filterDevices: function () {
Ext.getStore('Devices').each(this.updateDeviceVisibility, this, false);
}
});