diff options
author | Abyss777 <abyss@fox5.ru> | 2016-12-01 12:12:54 +0500 |
---|---|---|
committer | Abyss777 <abyss@fox5.ru> | 2016-12-01 12:12:54 +0500 |
commit | 74072cf3ca6acf67d228287e446e3013277e7408 (patch) | |
tree | a42fd6ce480f5005ce7028ade47aef1c04fb43cb | |
parent | b53b223a07dbba48321d42204ffbb07a33ac2caf (diff) | |
download | trackermap-web-74072cf3ca6acf67d228287e446e3013277e7408.tar.gz trackermap-web-74072cf3ca6acf67d228287e446e3013277e7408.tar.bz2 trackermap-web-74072cf3ca6acf67d228287e446e3013277e7408.zip |
Remove map view fit from loadReport
-rw-r--r-- | web/app/view/MapMarkerController.js | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/web/app/view/MapMarkerController.js b/web/app/view/MapMarkerController.js index 9b699c04..71a15839 100644 --- a/web/app/view/MapMarkerController.js +++ b/web/app/view/MapMarkerController.js @@ -202,25 +202,21 @@ Ext.define('Traccar.view.MapMarkerController', { this.addReportMarkers(store, data); - if (data.length > 0) { - this.reportRoute = []; - for (i = 0; i < data.length; i++) { - position = data[i]; - point = ol.proj.fromLonLat([ - position.get('longitude'), - position.get('latitude') - ]); - if (i === 0 || data[i].get('deviceId') !== data[i - 1].get('deviceId')) { - this.reportRoute.push(new ol.Feature({ - geometry: new ol.geom.LineString([]) - })); - this.reportRoute[this.reportRoute.length - 1].setStyle(this.getRouteStyle(data[i].get('deviceId'))); - this.getView().getRouteSource().addFeature(this.reportRoute[this.reportRoute.length - 1]); - } - this.reportRoute[this.reportRoute.length - 1].getGeometry().appendCoordinate(point); + this.reportRoute = []; + for (i = 0; i < data.length; i++) { + position = data[i]; + point = ol.proj.fromLonLat([ + position.get('longitude'), + position.get('latitude') + ]); + if (i === 0 || data[i].get('deviceId') !== data[i - 1].get('deviceId')) { + this.reportRoute.push(new ol.Feature({ + geometry: new ol.geom.LineString([]) + })); + this.reportRoute[this.reportRoute.length - 1].setStyle(this.getRouteStyle(data[i].get('deviceId'))); + this.getView().getRouteSource().addFeature(this.reportRoute[this.reportRoute.length - 1]); } - - this.getView().getMapView().fit(this.reportRoute[0].getGeometry(), this.getView().getMap().getSize()); + this.reportRoute[this.reportRoute.length - 1].getGeometry().appendCoordinate(point); } }, |