diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-11-21 11:08:11 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-11-21 11:08:11 +1300 |
commit | c4133052d79c82f30c53b60d9dda1b6d2972b4e2 (patch) | |
tree | 870feaaccc75ce2d5cbb9bab643530714975994b /web/app/view/Map.js | |
parent | 40674d8338c679a958ced0a94c4b61716775045d (diff) | |
download | trackermap-server-c4133052d79c82f30c53b60d9dda1b6d2972b4e2.tar.gz trackermap-server-c4133052d79c82f30c53b60d9dda1b6d2972b4e2.tar.bz2 trackermap-server-c4133052d79c82f30c53b60d9dda1b6d2972b4e2.zip |
Split latest and report into two layers
Diffstat (limited to 'web/app/view/Map.js')
-rw-r--r-- | web/app/view/Map.js | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/web/app/view/Map.js b/web/app/view/Map.js index 7d81699a3..2db7d479d 100644 --- a/web/app/view/Map.js +++ b/web/app/view/Map.js @@ -35,13 +35,17 @@ Ext.define('Traccar.view.Map', { return this.mapView; }, - getVectorSource: function () { - return this.vectorSource; + getLatestSource: function () { + return this.latestSource; + }, + + getReportSource: function () { + return this.reportSource; }, listeners: { afterrender: function () { - var user, server, layer, type, bingKey, vectorLayer, lat, lon, zoom, target; + var user, server, layer, type, bingKey, latestLayer, reportLayer, lat, lon, zoom, target; user = Traccar.app.getUser(); server = Traccar.app.getServer(); @@ -78,9 +82,14 @@ Ext.define('Traccar.view.Map', { }); } - this.vectorSource = new ol.source.Vector({}); - vectorLayer = new ol.layer.Vector({ - source: this.vectorSource + this.latestSource = new ol.source.Vector({}); + latestLayer = new ol.layer.Vector({ + source: this.latestSource + }); + + this.reportSource = new ol.source.Vector({}); + reportLayer = new ol.layer.Vector({ + source: this.reportSource }); lat = user.get('latitude') || server.get('latitude') || Traccar.Style.mapDefaultLat; @@ -95,7 +104,7 @@ Ext.define('Traccar.view.Map', { this.map = new ol.Map({ target: this.body.dom.id, - layers: [layer, vectorLayer], + layers: [layer, latestLayer, reportLayer], view: this.mapView }); |