highlight: increase fillOpacity for polygons

sqrt gives larger increase for low opacities like 0.2
while preserving some (tiny) shine-through for large values like 0.8
and is limited to the desired range of (0,1]
This commit is contained in:
Joachim Schleicher 2023-10-10 10:47:36 +02:00
parent 836c17f2e8
commit 9ef09512db

View file

@ -822,6 +822,7 @@ L.U.PathMixin = {
highlightPath: function () {
this.parentClass.prototype.setStyle.call(this, {
fillOpacity: Math.sqrt(this.getDynamicOption('fillOpacity')),
opacity: 1.0,
weight: 1.3 * this.getDynamicOption('weight'),
})
@ -829,6 +830,7 @@ L.U.PathMixin = {
resetPath: function () {
this.parentClass.prototype.setStyle.call(this, {
fillOpacity: this.getDynamicOption('fillOpacity'),
opacity: this.getDynamicOption('opacity'),
weight: this.getDynamicOption('weight'),
})