From 877ce085d5dab3c25a6131c1a8a77fadc2a0b766 Mon Sep 17 00:00:00 2001 From: Candid Dauth Date: Wed, 16 Jan 2019 01:45:06 +0100 Subject: [PATCH] Fix mouseover for bold lines --- frontend/app/leaflet/highlightableLayers.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/app/leaflet/highlightableLayers.js b/frontend/app/leaflet/highlightableLayers.js index 5a158b28..70b6e01e 100644 --- a/frontend/app/leaflet/highlightableLayers.js +++ b/frontend/app/leaflet/highlightableLayers.js @@ -110,9 +110,6 @@ fm.app.factory("fmHighlightableLayers", function(fmUtils) { } _regenerateStyle() { - this.options.opacity = 0; - this.options.weight = 20; - let isBright = fmUtils.getBrightness(this.options.color.replace(/^#/, "")) > 0.7; // A black border makes the lines look thicker, thus we decrease the thickness to make them look the original size again @@ -123,6 +120,9 @@ fm.app.factory("fmHighlightableLayers", function(fmUtils) { this.borderLayer.options.color = this.borderLayer.options.fillColor = isBright ? "#000000" : "#ffffff"; this.borderLayer.options.weight = this.lineLayer.options.weight * 2; + this.options.opacity = 0; + this.options.weight = Math.max(20, this.borderLayer.options.weight); + fmHighlightableLayers._updatePane(this, "fmAlmostOverPane"); fmHighlightableLayers._updatePane(this.lineLayer, this.options.highlight || this.options.rise ? "fmHighlightPane" : "overlayPane"); fmHighlightableLayers._updatePane(this.borderLayer, this.options.highlight || this.options.rise ? "fmHighlightShadowPane" : "fmShadowPane");