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/MapController.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/MapController.js')
-rw-r--r-- | web/app/view/MapController.js | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/web/app/view/MapController.js b/web/app/view/MapController.js index 711bdadf9..3d86cc4ff 100644 --- a/web/app/view/MapController.js +++ b/web/app/view/MapController.js @@ -121,7 +121,7 @@ Ext.define('Traccar.view.MapController', { marker = new ol.Feature(geometry); marker.set('record', device); this.latestMarkers[deviceId] = marker; - this.getView().getVectorSource().addFeature(marker); + this.getView().getLatestSource().addFeature(marker); style = this.getLatestMarker(this.getDeviceColor(device)); style.getText().setText(device.get('name')); @@ -141,7 +141,7 @@ Ext.define('Traccar.view.MapController', { geometry: new ol.geom.LineString([]) }); this.reportRoute.setStyle(this.getRouteStyle()); - this.getView().getVectorSource().addFeature(this.reportRoute); + this.getView().getReportSource().addFeature(this.reportRoute); for (i = 0; i < data.length; i++) { position = data[i]; @@ -155,7 +155,7 @@ Ext.define('Traccar.view.MapController', { marker = new ol.Feature(geometry); marker.set('record', position); this.reportMarkers[position.get('id')] = marker; - this.getView().getVectorSource().addFeature(marker); + this.getView().getReportSource().addFeature(marker); style = this.getReportMarker(); style.getImage().setRotation(position.get('course') * Math.PI / 180); @@ -169,18 +169,18 @@ Ext.define('Traccar.view.MapController', { }, clearReport: function (store) { - var vectorSource, key; - vectorSource = this.getView().getVectorSource(); + var reportSource, key; + reportSource = this.getView().getReportSource(); if (this.reportRoute) { - vectorSource.removeFeature(this.reportRoute); + reportSource.removeFeature(this.reportRoute); this.reportRoute = null; } if (this.reportMarkers) { for (key in this.reportMarkers) { if (this.reportMarkers.hasOwnProperty(key)) { - vectorSource.removeFeature(this.reportMarkers[key]); + reportSource.removeFeature(this.reportMarkers[key]); } } this.reportMarkers = {}; |