Skip to content

Commit

Permalink
Change popup-marker to always be in front of other markers
Browse files Browse the repository at this point in the history
  • Loading branch information
TBlueF committed Apr 8, 2024
1 parent 240ca6c commit fa966c4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions BlueMapCommon/webapp/src/js/PopupMarker.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down
3 changes: 2 additions & 1 deletion BlueMapCommon/webapp/src/js/util/CSS2DRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

}

Expand Down

0 comments on commit fa966c4

Please sign in to comment.