Change popup-marker to always be in front of other markers

This commit is contained in:
Lukas Rieger (Blue) 2024-04-08 13:37:34 +02:00
parent 240ca6c00e
commit fa966c4363
No known key found for this signature in database
GPG Key ID: AA33883B1BBA03E6
2 changed files with 3 additions and 1 deletions

View File

@ -43,6 +43,7 @@ export class PopupMarker extends Marker {
this.elementObject = new CSS2DObject(htmlToElement(`<div id="bm-marker-${this.data.id}" class="bm-marker-${this.data.type}">Test</div>`));
this.elementObject.position.set(0.5, 1, 0.5);
this.elementObject.disableDepthTest = true;
this.addEventListener( 'removed', () => {
if (this.element.parentNode) this.element.parentNode.removeChild(this.element);
});

View File

@ -208,7 +208,8 @@ var CSS2DRenderer = function (events = null) {
for ( var i = 0, l = sorted.length; i < l; i ++ ) {
sorted[ i ].element.style.zIndex = zMax - i;
let o = sorted[ i ];
o.element.style.zIndex = o.disableDepthTest ? zMax + 1 : zMax - i;
}