aboutsummaryrefslogtreecommitdiff
path: root/web/app/view/map/MapController.js
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-06-27 10:39:47 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2015-06-27 10:39:47 +1200
commitdeea5b703fd83e699d62600d93b3e28ac71188a1 (patch)
treee8d015777efdfe33f0bbd50b44d5b74324771c77 /web/app/view/map/MapController.js
parent2f8c3c0a31c332457997dfef0837d039074078c3 (diff)
downloadtrackermap-server-deea5b703fd83e699d62600d93b3e28ac71188a1.tar.gz
trackermap-server-deea5b703fd83e699d62600d93b3e28ac71188a1.tar.bz2
trackermap-server-deea5b703fd83e699d62600d93b3e28ac71188a1.zip
Fix few minor UI issues
Diffstat (limited to 'web/app/view/map/MapController.js')
-rw-r--r--web/app/view/map/MapController.js24
1 files changed, 12 insertions, 12 deletions
diff --git a/web/app/view/map/MapController.js b/web/app/view/map/MapController.js
index f830593e3..27a42a2ce 100644
--- a/web/app/view/map/MapController.js
+++ b/web/app/view/map/MapController.js
@@ -170,6 +170,7 @@ Ext.define('Traccar.view.map.MapController', {
if (this.reportRoute !== undefined) {
vectorSource.removeFeature(this.reportRoute);
+ this.reportRoute = undefined;
}
if (this.reportRoutePoints !== undefined) {
@@ -178,9 +179,8 @@ Ext.define('Traccar.view.map.MapController', {
vectorSource.removeFeature(this.reportRoutePoints[key]);
}
}
+ this.reportRoutePoints = {};
}
-
- this.reportRoutePoints = {};
},
selectPosition: function(feature) {
@@ -188,22 +188,22 @@ Ext.define('Traccar.view.map.MapController', {
this.currentFeature.setStyle(this.currentFeature.get('originalStyle'));
}
- feature.setStyle(this.getMarkerStyle(styles.map_select_radius, styles.map_select_color));
+ if (feature !== undefined) {
+ feature.setStyle(this.getMarkerStyle(styles.map_select_radius, styles.map_select_color));
- var pan = ol.animation.pan({
- duration: styles.map_delay,
- source: this.getView().mapView.getCenter()
- });
- this.getView().map.beforeRender(pan);
- this.getView().mapView.setCenter(feature.getGeometry().getCoordinates());
+ var pan = ol.animation.pan({
+ duration: styles.map_delay,
+ source: this.getView().mapView.getCenter()
+ });
+ this.getView().map.beforeRender(pan);
+ this.getView().mapView.setCenter(feature.getGeometry().getCoordinates());
+ }
this.currentFeature = feature;
},
selectDevice: function(device) {
- if (this.liveData[device.get('id')] !== undefined) {
- this.selectPosition(this.liveData[device.get('id')]);
- }
+ this.selectPosition(this.liveData[device.get('id')]);
},
selectReport: function(position) {