From 2585c44db8824e413946b8daa2e28bfb94c13475 Mon Sep 17 00:00:00 2001 From: Marat Fayzullin Date: Mon, 7 Aug 2023 22:27:18 -0400 Subject: [PATCH] Simplifying code a bit. --- htdocs/map-leaflet.js | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/htdocs/map-leaflet.js b/htdocs/map-leaflet.js index fd39d310..3532c9ae 100644 --- a/htdocs/map-leaflet.js +++ b/htdocs/map-leaflet.js @@ -315,11 +315,9 @@ MapManager.prototype.processUpdates = function(updates) { }); marker.div = marker.create(); var offset = marker.getAnchorOffset(); - offset[0] *= -1; - offset[1] *= -1; marker.setIcon(L.divIcon({ html: marker.div, - iconAnchor: [offset[1], offset[0]], + iconAnchor: [-offset[1], -offset[0]], className: 'dummy' })); } @@ -359,15 +357,10 @@ MapManager.prototype.processUpdates = function(updates) { if (!marker) { marker = new LFeatureMarker(); marker.div = marker.create(); - // marker.div.style.width = 'auto'; - // marker.div.style.height = 'auto'; - // marker.div.style.lineHeight = 'inherit'; var offset = marker.getAnchorOffset(); - offset[0] *= -1; - offset[1] *= -1; marker.setIcon(L.divIcon({ html: marker.div, - iconAnchor: [offset[1], offset[0]], + iconAnchor: [-offset[1], -offset[0]], className: 'dummy' }));