Do not modify tooltipAnchor inplace, as it's shared by all markers

fix #1223
This commit is contained in:
Yohan Boniface 2023-07-22 09:04:29 +02:00
parent 299e9e0821
commit 2b1b80ae23

View file

@ -581,7 +581,7 @@ L.U.Marker = L.Marker.extend({
},
_getTooltipAnchor: function () {
const anchor = this.options.icon.options.tooltipAnchor,
const anchor = this.options.icon.options.tooltipAnchor.clone(),
direction = this.getOption('labelDirection')
if (direction === 'left') {
anchor.x *= -1