Skip to content

Commit

Permalink
fix #5024
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanMOlson committed Nov 9, 2024
1 parent 963aacb commit cde15ad
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/geo/projection/covering_tiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ export function coveringTiles(transform: IReadonlyTransform, options: CoveringTi
const stack: Array<CoveringTilesStackEntry> = [];
const result: Array<CoveringTilesResult> = [];

if (transform.renderWorldCopies) {
if (transform.renderWorldCopies && detailsProvider.allowWorldCopies()) {
// Render copy of the globe thrice on both sides
for (let i = 1; i <= 3; i++) {
stack.push(newRootTile(-i));
Expand Down
5 changes: 5 additions & 0 deletions src/geo/projection/covering_tiles_details_provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,9 @@ export interface CoveringTilesDetailsProvider {
* Whether to allow variable zoom, which is used at high pitch angle to avoid loading an excessive amount of tiles.
*/
allowVariableZoom: (transform: IReadonlyTransform, options: CoveringTilesOptions) => boolean;

/**
* Whether to allow world copies to be rendered.
*/
allowWorldCopies: () => boolean;
}
4 changes: 4 additions & 0 deletions src/geo/projection/globe_covering_tiles_details_provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ export class GlobeCoveringTilesDetailsProvider implements CoveringTilesDetailsPr
return coveringZoomLevel(transform, options) > 4;
}

allowWorldCopies(): boolean {
return false;
}

getTileAABB(tileID: { x: number; y: number; z: number }, wrap: number, elevation: number, options: CoveringTilesOptions) {
return this._aabbCache.getTileAABB(tileID, wrap, elevation, options);
}
Expand Down
2 changes: 1 addition & 1 deletion src/geo/projection/globe_transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ export class GlobeTransform implements ITransform {
return this._helper.unmodified;
}
get renderWorldCopies(): boolean {
return this.isGlobeRendering ? false : this._helper.renderWorldCopies;
return this._helper.renderWorldCopies;
}

//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,8 @@ export class MercatorCoveringTilesDetailsProvider implements CoveringTilesDetail
const maxConstantZoomPitch = clamp(78.5 - zfov / 2, 0.0, 60.0);
return (!!options.terrain || transform.pitch > maxConstantZoomPitch || transform.padding.top >= 0.1)
}

allowWorldCopies(): boolean {
return true;
}
}

0 comments on commit cde15ad

Please sign in to comment.