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.
This commit is contained in:
Yohan Boniface 2025-02-11 18:01:01 +01:00 committed by GitHub
commit fb6df6f955
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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)),