feat: make the tooltip sticky in hover mode for paths

Until now, it was displayed on the path (line or polygon)
"center". So when zoomed in, if the center is not on the
screen, the tooltip will not be visible.
This commit is contained in:
Yohan Boniface 2025-02-11 15:49:53 +01:00
parent c71a6aafdb
commit 04966cc068

View file

@ -293,6 +293,11 @@ const PathMixin = {
this.on('popupclose', this._redraw)
},
bindTooltip: function (content, options) {
options.sticky = !options.permanent
this.parentClass.prototype.bindTooltip.call(this, content, options)
},
highlightPath: function () {
this.parentClass.prototype.setStyle.call(this, {
fillOpacity: Math.sqrt(this.feature.getDynamicOption('fillOpacity', 1.0)),