Fix tooltip anchor not updated anymore according to the direction
This is a change in Leaflet 1.7.0 cf https://github.com/Leaflet/Leaflet/issues/7302
This commit is contained in:
parent
891c23747f
commit
37732b8f16
1 changed files with 14 additions and 0 deletions
|
@ -580,6 +580,20 @@ L.U.Marker = L.Marker.extend({
|
||||||
this.resetTooltip()
|
this.resetTooltip()
|
||||||
},
|
},
|
||||||
|
|
||||||
|
_getTooltipAnchor: function () {
|
||||||
|
const anchor = this.options.icon.options.tooltipAnchor,
|
||||||
|
direction = this.getOption('labelDirection')
|
||||||
|
if (direction === 'left') {
|
||||||
|
anchor.x *= -1
|
||||||
|
} else if (direction === 'bottom') {
|
||||||
|
anchor.x = 0
|
||||||
|
anchor.y = 0
|
||||||
|
} else if (direction === 'top') {
|
||||||
|
anchor.x = 0
|
||||||
|
}
|
||||||
|
return anchor
|
||||||
|
},
|
||||||
|
|
||||||
disconnectFromDataLayer: function (datalayer) {
|
disconnectFromDataLayer: function (datalayer) {
|
||||||
this.options.icon.datalayer = null
|
this.options.icon.datalayer = null
|
||||||
L.U.FeatureMixin.disconnectFromDataLayer.call(this, datalayer)
|
L.U.FeatureMixin.disconnectFromDataLayer.call(this, datalayer)
|
||||||
|
|
Loading…
Reference in a new issue