Fix PlayerMarker name disappearing when hidden
This commit is contained in:
parent
016b784634
commit
5896d4504c
@ -58,8 +58,7 @@ export class PlayerIcon extends Layer implements Icon<PlayerIconOptions> {
|
|||||||
DomUtil.remove(oldIcon);
|
DomUtil.remove(oldIcon);
|
||||||
}
|
}
|
||||||
|
|
||||||
const player = this._player;
|
this._currentName = undefined;
|
||||||
|
|
||||||
this._container = document.createElement('div');
|
this._container = document.createElement('div');
|
||||||
this._container.classList.add('marker', 'marker--player', 'leaflet-marker-icon');
|
this._container.classList.add('marker', 'marker--player', 'leaflet-marker-icon');
|
||||||
|
|
||||||
@ -73,7 +72,7 @@ export class PlayerIcon extends Layer implements Icon<PlayerIconOptions> {
|
|||||||
this._playerImage.height = this._playerImage.width = getImagePixelSize(this.options.imageSize);
|
this._playerImage.height = this._playerImage.width = getImagePixelSize(this.options.imageSize);
|
||||||
|
|
||||||
if (this.options.showSkin) {
|
if (this.options.showSkin) {
|
||||||
getMinecraftHead(player, this.options.imageSize).then(head => {
|
getMinecraftHead(this._player, this.options.imageSize).then(head => {
|
||||||
this._playerImage!.src = head.src;
|
this._playerImage!.src = head.src;
|
||||||
}).catch(() => {});
|
}).catch(() => {});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user