mirror of
https://github.com/BlueMap-Minecraft/BlueMapVue.git
synced 2025-01-27 08:21:19 +01:00
Fix popup-click on lowres-layer and on debug
This commit is contained in:
parent
82e2cc0934
commit
585dfc2c36
@ -1 +1 @@
|
||||
Subproject commit a9d9cb991bd30bd593fd94dd641b2c949cea7232
|
||||
Subproject commit 050cde0a0ce7fdfe1194dbc70b31dce8bad5efd4
|
@ -681,7 +681,8 @@ export class BlueMapApp {
|
||||
mapInteraction = event => {
|
||||
if (event.detail.data.doubleTap) {
|
||||
let cm = this.mapViewer.controlsManager;
|
||||
let pos = (event.detail.hit ? event.detail.hit.point : false) || event.detail.object.getWorldPosition(new Vector3());
|
||||
let pos = event.detail.hit?.point || event.detail.object?.getWorldPosition(new Vector3());
|
||||
if (!pos) return;
|
||||
|
||||
let startDistance = cm.distance;
|
||||
let targetDistance = Math.max(startDistance * 0.25, 5);
|
||||
|
@ -72,9 +72,13 @@ export class PopupMarker extends Marker {
|
||||
let isHires = true;
|
||||
let int = evt.detail.hiresHit;
|
||||
|
||||
if (!int) {
|
||||
isHires = false;
|
||||
int = evt.detail.lowresHit;
|
||||
if (evt.detail.lowresHits) {
|
||||
for (let i = 0; i < evt.detail.lowresHits.length; i++) {
|
||||
if (!int) {
|
||||
isHires = false;
|
||||
int = evt.detail.lowresHits[i];
|
||||
} else break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!int) return;
|
||||
@ -164,12 +168,16 @@ export class PopupMarker extends Marker {
|
||||
let info = "";
|
||||
|
||||
if (isHires) {
|
||||
let hrPath = evt.detail.hiresHit.object.userData.tileUrl;
|
||||
let hrPath = evt.detail.hiresHit?.object?.userData?.tileUrl;
|
||||
info += `<div>${hrPath}</div>`;
|
||||
}
|
||||
|
||||
let lrPath = evt.detail.lowresHit.object.userData.tileUrl;
|
||||
info += `<div>${lrPath}</div>`;
|
||||
if (evt.detail.lowresHits) {
|
||||
for (let i = 0; i < evt.detail.lowresHits.length; i++) {
|
||||
let lrPath = evt.detail.lowresHits[i]?.object?.userData?.tileUrl;
|
||||
if (lrPath) info += `<div>${lrPath}</div>`;
|
||||
}
|
||||
}
|
||||
|
||||
this.element.innerHTML += `
|
||||
<hr>
|
||||
|
Loading…
Reference in New Issue
Block a user