Merge pull request #1224 from umap-project/fix-tooltip-position

Do not modify tooltipAnchor inplace, as it's shared by all markers
This commit is contained in:
Yohan Boniface 2023-07-22 09:11:53 +02:00 committed by GitHub
commit bd339db397
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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