mirror of
https://github.com/BlueMap-Minecraft/BlueMapWeb.git
synced 2025-01-07 15:47:35 +01:00
Make label work for HTML-Marker
This commit is contained in:
parent
a7a382d1d9
commit
62ae25c6ae
@ -36,6 +36,8 @@ export class HtmlMarker extends Marker {
|
||||
Object.defineProperty(this, 'isHtmlMarker', {value: true});
|
||||
this.data.type = "html";
|
||||
|
||||
this.data.label = null;
|
||||
|
||||
this.elementObject = new CSS2DObject(htmlToElement(`<div id="bm-marker-${this.data.id}" class="bm-marker-${this.data.type}"></div>`));
|
||||
this.elementObject.onBeforeRender = (renderer, scene, camera) => this.onBeforeRender(renderer, scene, camera);
|
||||
|
||||
@ -88,6 +90,7 @@ export class HtmlMarker extends Marker {
|
||||
/**
|
||||
* @param markerData {{
|
||||
* position: {x: number, y: number, z: number},
|
||||
* label: string,
|
||||
* anchor: {x: number, y: number},
|
||||
* html: string,
|
||||
* minDistance: number,
|
||||
@ -102,6 +105,9 @@ export class HtmlMarker extends Marker {
|
||||
this.position.setY(pos.y || 0);
|
||||
this.position.setZ(pos.z || 0);
|
||||
|
||||
// update label
|
||||
this.data.label = markerData.label || null;
|
||||
|
||||
// update anchor
|
||||
let anch = markerData.anchor || {};
|
||||
this.anchor.setX(anch.x || 0);
|
||||
|
Loading…
Reference in New Issue
Block a user