From b4e2d507666121c8219894fb108be43de22e48d0 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 15 Jul 2017 18:52:03 +1200 Subject: Hide event marker if no position --- web/app/view/map/MapMarkerController.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'web/app/view/map') diff --git a/web/app/view/map/MapMarkerController.js b/web/app/view/map/MapMarkerController.js index 5d41932e..aa5be0f7 100644 --- a/web/app/view/map/MapMarkerController.js +++ b/web/app/view/map/MapMarkerController.js @@ -495,9 +495,13 @@ Ext.define('Traccar.view.map.MapMarkerController', { }, selectEvent: function (position) { - var maker = this.addReportMarker(position); - maker.set('event', true); - this.selectMarker(maker, true); + if (position) { + var maker = this.addReportMarker(position); + maker.set('event', true); + this.selectMarker(maker, true); + } else if (this.selectedMarker && this.selectedMarker.get('event')) { + this.selectMarker(null, false); + } }, selectFeature: function (feature) { -- cgit v1.2.3