Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const applyTransformControls = () => {
// Apply helper camera offset to main (map view) camera.
this.mapView.camera.position.add(cameraRelativeToEye.position);
// Make sure that pitch limit contraint is preserved
const ypr = MapViewUtils.extractYawPitchRoll(cameraRelativeToEye.quaternion);
ypr.pitch = Math.max(
Math.min(ypr.pitch, MathUtils.degToRad(this.mapControls.maxPitchAngle)),
0
);
// Finally apply rotation from transformation gizmo.
this.mapControls.setRotation(
MathUtils.radToDeg(ypr.yaw),
MathUtils.radToDeg(ypr.pitch)
);
// Reset RTE camera orientation according to constraints applied.
cameraRelativeToEye.copy(this.mapView.camera);
// Reset RTE camera position to origin.
cameraRelativeToEye.position.setScalar(0);
transformControls.update();
};
applyTransformControls();
const applyTransformControls = () => {
// Apply helper camera offset to main (map view) camera.
this.mapView.camera.position.add(cameraRelativeToEye.position);
// Make sure that pitch limit contraint is preserved
const ypr = MapViewUtils.extractYawPitchRoll(cameraRelativeToEye.quaternion);
ypr.pitch = Math.max(
Math.min(ypr.pitch, MathUtils.degToRad(this.mapControls.maxPitchAngle)),
0
);
// Finally apply rotation from transformation gizmo.
this.mapControls.setRotation(
MathUtils.radToDeg(ypr.yaw),
MathUtils.radToDeg(ypr.pitch)
);
// Reset RTE camera orientation according to constraints applied.
cameraRelativeToEye.copy(this.mapView.camera);
// Reset RTE camera position to origin.
cameraRelativeToEye.position.setScalar(0);
transformControls.update();
};
applyTransformControls();
*/
geometryLevelOffset?: number;
/**
* Enable debug display for generated tiles.
* Default is false.
*/
debugTiles?: boolean;
}
/**
* [[DataSource]] providing geometry for poles
*/
export class PolarTileDataSource extends DataSource {
private m_tilingScheme: TilingScheme = polarTilingScheme;
private m_maxLatitude = MathUtils.radToDeg(MercatorConstants.MAXIMUM_LATITUDE);
private m_geometryLevelOffset: number;
private m_debugTiles: boolean;
private m_styleSetEvaluator?: StyleSetEvaluator;
private m_northPoleMaterial?: THREE.Material;
private m_southPoleMaterial?: THREE.Material;
constructor({
name = "polar",
styleSetName,
minZoomLevel,
maxZoomLevel,
storageLevelOffset = -2,
geometryLevelOffset = -1,
debugTiles = false
}: PolarTileDataSourceOptions) {