From cdd83e0d13961c3465c7faf554ea8c709bd761b3 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sun, 8 Nov 2015 13:47:26 +1300 Subject: Add map feature selection event --- web/app/view/Map.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'web/app/view/Map.js') diff --git a/web/app/view/Map.js b/web/app/view/Map.js index 2c73f4cc5..b6c8cf815 100644 --- a/web/app/view/Map.js +++ b/web/app/view/Map.js @@ -95,6 +95,12 @@ Ext.define('Traccar.view.Map', { layers: [layer, vectorLayer], view: this.mapView }); + + this.map.on("click", function(e) { + this.map.forEachFeatureAtPixel(e.pixel, function (feature, layer) { + this.fireEvent('selectFeature', feature); + }, this); + }, this); }, resize: function () { -- cgit v1.2.3