Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// lays directly on the ground surface.
if (useElevationRangeSource) {
const range = elevationRangeSource!.getElevationRange(childTileKey);
geoBox.southWest.altitude = range.minElevation;
geoBox.northEast.altitude = range.maxElevation;
calculationFinal =
calculationFinal &&
range.calculationStatus === CalculationStatus.FinalPrecise;
}
let subTileArea = 0;
const obbIntersections: boolean =
this.mapView.projection.type === ProjectionType.Spherical;
if (obbIntersections) {
const obb = new OrientedBox3();
this.mapView.projection.projectBox(geoBox, obb);
subTileArea = this.computeSubTileArea(obb);
} else {
this.mapView.projection.projectBox(geoBox, tileBounds);
subTileArea = this.computeSubTileArea(tileBounds);
}
if (subTileArea > 0) {
const subTileEntry = new TileKeyEntry(
childTileKey,
subTileArea,
offset,
geoBox.southWest.altitude, // minElevation
geoBox.northEast.altitude // maxElevation
);
this.m_tileKeyEntries.set(tileKeyAndOffset, subTileEntry);
private getTileCenter(tileKey: TileKey) {
const geoBox = webMercatorTilingScheme.getGeoBox(tileKey);
const tileBounds = this.m_projection.projectBox(geoBox, new OrientedBox3());
return tileBounds.position;
}