Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function startTransition(mapView: MapView, location: Location) {
const startPosition = mapView.camera.position.clone();
const startQuaternion = mapView.camera.quaternion.clone();
const targetPosition = MapViewUtils.getCameraPositionFromTargetCoordinates(
location.target,
location.distance,
location.heading,
location.tilt,
mapView.projection
);
const targetQuaternion = MapViewUtils.getCameraRotationAtTarget(
mapView.projection,
location.target,
location.heading,
location.tilt
);
const startTime = Date.now();
const curve = new THREE.CatmullRomCurve3([startPosition, targetPosition]);
function startTransition(
mapView: MapView,
target: GeoCoordinates,
tilt: number,
azimuth: number,
distance: number
) {
const startPosition = mapView.camera.position.clone();
const startQuaternion = mapView.camera.quaternion.clone();
const targetPosition = MapViewUtils.getCameraPositionFromTargetCoordinates(
target,
distance,
azimuth,
tilt,
mapView.projection
);
const targetQuaternion = MapViewUtils.getCameraRotation(
mapView.projection,
target,
azimuth,
tilt
);
const startTime = Date.now();
function setLocation(
mapView: MapView,
target: GeoCoordinates,
tilt: number,
azimuth: number,
distance: number
) {
MapViewUtils.getCameraPositionFromTargetCoordinates(
target,
distance,
0,
0,
mapView.projection,
mapView.camera.position
);
MapViewUtils.getCameraRotation(
mapView.projection,
target,
azimuth,
tilt,
mapView.camera.quaternion
);
}