aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-06-21 17:40:58 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2015-06-21 17:40:58 +1200
commit102c142c5868ab572c23eb3a3f65979c68180fc1 (patch)
treeed1179c8fea642d452381209782c2d7c67801e46
parente36f444cac7abef61dd63a7104f17e6b8de1637c (diff)
downloadtrackermap-server-102c142c5868ab572c23eb3a3f65979c68180fc1.tar.gz
trackermap-server-102c142c5868ab572c23eb3a3f65979c68180fc1.tar.bz2
trackermap-server-102c142c5868ab572c23eb3a3f65979c68180fc1.zip
Fix first report problem
-rw-r--r--web/app/view/map/MapController.js14
1 files changed, 9 insertions, 5 deletions
diff --git a/web/app/view/map/MapController.js b/web/app/view/map/MapController.js
index cbe3ea6c3..f830593e3 100644
--- a/web/app/view/map/MapController.js
+++ b/web/app/view/map/MapController.js
@@ -167,12 +167,16 @@ Ext.define('Traccar.view.map.MapController', {
reportClear: function() {
var index;
var vectorSource = this.getView().vectorSource;
-
- vectorSource.removeFeature(this.reportRoute);
- for (var key in this.reportRoutePoints) {
- if (this.reportRoutePoints.hasOwnProperty(key)) {
- vectorSource.removeFeature(this.reportRoutePoints[key]);
+ if (this.reportRoute !== undefined) {
+ vectorSource.removeFeature(this.reportRoute);
+ }
+
+ if (this.reportRoutePoints !== undefined) {
+ for (var key in this.reportRoutePoints) {
+ if (this.reportRoutePoints.hasOwnProperty(key)) {
+ vectorSource.removeFeature(this.reportRoutePoints[key]);
+ }
}
}