diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-11-21 11:22:47 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-11-21 11:22:47 +1300 |
commit | 6280260c9d767844e8233912064443f166900406 (patch) | |
tree | ac6ff462bee657377f086e169c0b1fe05818690c /web/app/view/MapController.js | |
parent | c4133052d79c82f30c53b60d9dda1b6d2972b4e2 (diff) | |
download | trackermap-server-6280260c9d767844e8233912064443f166900406.tar.gz trackermap-server-6280260c9d767844e8233912064443f166900406.tar.bz2 trackermap-server-6280260c9d767844e8233912064443f166900406.zip |
Separate route into another layer
Diffstat (limited to 'web/app/view/MapController.js')
-rw-r--r-- | web/app/view/MapController.js | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/web/app/view/MapController.js b/web/app/view/MapController.js index 3d86cc4ff..2b441399b 100644 --- a/web/app/view/MapController.js +++ b/web/app/view/MapController.js @@ -141,7 +141,7 @@ Ext.define('Traccar.view.MapController', { geometry: new ol.geom.LineString([]) }); this.reportRoute.setStyle(this.getRouteStyle()); - this.getView().getReportSource().addFeature(this.reportRoute); + this.getView().getRouteSource().addFeature(this.reportRoute); for (i = 0; i < data.length; i++) { position = data[i]; @@ -169,18 +169,17 @@ Ext.define('Traccar.view.MapController', { }, clearReport: function (store) { - var reportSource, key; - reportSource = this.getView().getReportSource(); + var key; if (this.reportRoute) { - reportSource.removeFeature(this.reportRoute); + this.getView().getRouteSource().removeFeature(this.reportRoute); this.reportRoute = null; } if (this.reportMarkers) { for (key in this.reportMarkers) { if (this.reportMarkers.hasOwnProperty(key)) { - reportSource.removeFeature(this.reportMarkers[key]); + this.getView().getReportSource().removeFeature(this.reportMarkers[key]); } } this.reportMarkers = {}; |