Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private computeRequiredInitialRootTileKeys(worldCenter: THREE.Vector3) {
this.m_rootTileKeys = [];
const rootTileKey = TileKey.fromRowColumnLevel(0, 0, 0);
const tileWrappingEnabled = this.mapView.projection.type === ProjectionType.Planar;
if (!tileWrappingEnabled || !this.m_tileWrappingEnabled) {
this.m_rootTileKeys.push(new TileKeyEntry(rootTileKey, 0, 0, 0));
return;
}
const worldGeoPoint = this.mapView.projection.unprojectPoint(worldCenter);
const startOffset = Math.round(worldGeoPoint.longitude / 360.0);
// This algorithm computes the number of offsets we need to test. The following diagram may
// help explain the algorithm below.
//
// |🎥
// |.\ .
// | . \ .