From a822fac904282763183575beee9789d67da42846 Mon Sep 17 00:00:00 2001 From: Marat Fayzullin Date: Thu, 28 Sep 2023 22:41:39 -0400 Subject: [PATCH] Leaflet airplane markers finally fixed? --- htdocs/lib/Leaflet.js | 7 ++----- htdocs/lib/MapMarkers.js | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/htdocs/lib/Leaflet.js b/htdocs/lib/Leaflet.js index 898fffea..8951fb9d 100644 --- a/htdocs/lib/Leaflet.js +++ b/htdocs/lib/Leaflet.js @@ -8,14 +8,11 @@ function LMarker () { LMarker.prototype.onAdd = function() { this.div = this.create(); - var offset = this.getAnchorOffset(); - var size = this.getSize(); this.setIcon(L.divIcon({ html : this.div, - iconSize : size, -// iconAnchor : [size[0]/2, size[1]/2], - popupAnchor : offset, + iconSize : this.getSize(), + popupAnchor : this.getAnchorOffset(), className : 'dummy' })); }; diff --git a/htdocs/lib/MapMarkers.js b/htdocs/lib/MapMarkers.js index 2e205a7c..3cacae9b 100644 --- a/htdocs/lib/MapMarkers.js +++ b/htdocs/lib/MapMarkers.js @@ -756,7 +756,7 @@ AircraftMarker.prototype.getAnchorOffset = function() { }; AircraftMarker.prototype.getSize = function() { - return [72 * this.scale, 72 * this.scale]; + return [72, 72]; }; AircraftMarker.prototype.getInfoHTML = function(name, receiverMarker = null) {