Skip to content

Commit

Permalink
adjust conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
jjspace committed Jul 29, 2024
1 parent 481b372 commit 688f71e
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions packages/engine/Source/Scene/BingMapsImageryProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,15 @@ function metadataSuccess(data, imageryProviderBuilder) {
imageryProviderBuilder.maximumLevel = resource.zoomMax - 1;
imageryProviderBuilder.imageUrlSubdomains = resource.imageUrlSubdomains;
imageryProviderBuilder.imageUrlTemplate = resource.imageUrl;
const validProviders = !defined(resource.imageryProviders)
? resource.imageryProviders
: resource.imageryProviders.filter((provider) =>
// prevent issues with the imagery API from crashing the viewer when the expected properties are not there
// See https://github.com/CesiumGS/cesium/issues/12088
provider.coverageAreas?.some((area) => defined(area.bbox))
);

let validProviders = resource.imageryProviders;
if (defined(resource.imageryProviders)) {
// prevent issues with the imagery API from crashing the viewer when the expected properties are not there
// See https://github.com/CesiumGS/cesium/issues/12088
validProviders = resource.imageryProviders.filter((provider) =>
provider.coverageAreas?.some((area) => defined(area.bbox))
);
}
imageryProviderBuilder.attributionList = validProviders;
}

Expand Down

0 comments on commit 688f71e

Please sign in to comment.