Skip to content

Commit

Permalink
Fix map hires sometimes not loading when loading a map
Browse files Browse the repository at this point in the history
  • Loading branch information
TBlueF committed Feb 25, 2024
1 parent ceb31b6 commit c9a8c83
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions BlueMapCommon/webapp/src/js/BlueMapApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -726,6 +726,7 @@ export class BlueMapApp {
controls.ortho = parseFloat(values[8]);

this.updatePageAddress();
this.mapViewer.updateLoadedMapArea();

return true;
}
Expand Down
8 changes: 5 additions & 3 deletions BlueMapCommon/webapp/src/js/controls/ControlsManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit c9a8c83

Please sign in to comment.