From 1cd928bbb8437cd02204cb0e951a03033543822a Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 14 Nov 2015 11:59:48 +1300 Subject: Show hand when hover on marker --- web/app/view/Map.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/web/app/view/Map.js b/web/app/view/Map.js index 849f678a7..3be450cf4 100644 --- a/web/app/view/Map.js +++ b/web/app/view/Map.js @@ -41,7 +41,7 @@ Ext.define('Traccar.view.Map', { listeners: { afterrender: function () { - var user, server, layer, type, bingKey, vectorLayer, lat, lon, zoom; + var user, server, layer, type, bingKey, vectorLayer, lat, lon, zoom, target; user = Traccar.app.getUser(); server = Traccar.app.getServer(); @@ -99,6 +99,22 @@ Ext.define('Traccar.view.Map', { view: this.mapView }); + target = this.map.getTarget(); + if (typeof target === 'string') { + target = Ext.get(target).dom; + } + + this.map.on('pointermove', function (e) { + var hit = this.forEachFeatureAtPixel(e.pixel, function(feature, layer) { + return true; + }); + if (hit) { + target.style.cursor = 'pointer'; + } else { + target.style.cursor = ''; + } + }); + this.map.on('click', function (e) { this.map.forEachFeatureAtPixel(e.pixel, function (feature, layer) { this.fireEvent('selectFeature', feature); -- cgit v1.2.3