aboutsummaryrefslogtreecommitdiff
path: root/web/app/view/map
diff options
context:
space:
mode:
Diffstat (limited to 'web/app/view/map')
-rw-r--r--web/app/view/map/MapMarkerController.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/web/app/view/map/MapMarkerController.js b/web/app/view/map/MapMarkerController.js
index aa5be0f7..951a8253 100644
--- a/web/app/view/map/MapMarkerController.js
+++ b/web/app/view/map/MapMarkerController.js
@@ -454,7 +454,9 @@ Ext.define('Traccar.view.map.MapMarkerController', {
if (this.selectedMarker) {
if (this.selectedMarker.get('event')) {
this.getView().getMarkersSource().removeFeature(this.selectedMarker);
- this.fireEvent('deselectevent');
+ if (!marker || !marker.get('event')) {
+ this.fireEvent('deselectevent');
+ }
} else if (!Ext.getStore('ReportRoute').showMarkers &&
this.selectedMarker.get('record') instanceof Traccar.model.Position) {
this.getView().getMarkersSource().removeFeature(this.selectedMarker);
@@ -495,6 +497,7 @@ Ext.define('Traccar.view.map.MapMarkerController', {
},
selectEvent: function (position) {
+ this.fireEvent('deselectfeature');
if (position) {
var maker = this.addReportMarker(position);
maker.set('event', true);