Fix map hires sometimes not loading when loading a map

This commit is contained in:
Lukas Rieger (Blue) 2024-02-25 15:09:10 +01:00
parent ceb31b68eb
commit c9a8c83d6e
No known key found for this signature in database
GPG Key ID: AA33883B1BBA03E6
2 changed files with 6 additions and 3 deletions

View File

@ -726,6 +726,7 @@ export class BlueMapApp {
controls.ortho = parseFloat(values[8]);
this.updatePageAddress();
this.mapViewer.updateLoadedMapArea();
return true;
}

View File

@ -58,8 +58,8 @@ export class ControlsManager {
this.lastOrtho = this.ortho;
this.lastTilt = this.tilt;
this.lastMapUpdatePosition = this.position.clone();
this.lastMapUpdateDistance = this.distance;
this.lastMapUpdatePosition = null;
this.lastMapUpdateDistance = null;
this.averageDeltaTime = 16;
@ -157,9 +157,11 @@ export class ControlsManager {
}
if (
this.lastMapUpdatePosition === null ||
this.lastMapUpdateDistance === null ||
Math.abs(this.lastMapUpdatePosition.x - this.position.x) >= triggerDistance ||
Math.abs(this.lastMapUpdatePosition.z - this.position.z) >= triggerDistance ||
(this.distance < 1000 && this.lastMapUpdateDistance > 1000)
(this.distance < 1000 && this.lastMapUpdateDistance >= 1000)
) {
this.lastMapUpdatePosition = this.position.clone();
this.lastMapUpdateDistance = this.distance;