Compare commits

..

3 commits

Author SHA1 Message Date
Yohan Boniface
97c9f9ed88
Merge e666f02b88 into fb6df6f955 2025-02-12 10:11:16 +01:00
Yohan Boniface
fb6df6f955
feat: make the tooltip sticky in hover mode for paths (#2507)
Some checks failed
Test & Docs / tests (postgresql, 3.10) (push) Has been cancelled
Test & Docs / tests (postgresql, 3.12) (push) Has been cancelled
Test & Docs / lint (push) Has been cancelled
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.
2025-02-11 18:01:01 +01:00
Yohan Boniface
04966cc068 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.
2025-02-11 15:51:43 +01:00

View file

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