Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
position: THREE.Vector2,
flipY: boolean = false,
target: THREE.Vector2
): THREE.Vector2 {
if (
decodeInfo.worldTileProjectionCookie === undefined ||
decodeInfo.worldTileProjectionCookie.extents !== extents
) {
decodeInfo.worldTileProjectionCookie = createWorldTileTransformationCookie(
extents,
decodeInfo
);
}
const { top, left, scale } = decodeInfo.worldTileProjectionCookie;
const R = EarthConstants.EQUATORIAL_CIRCUMFERENCE;
return target.set(
((left + position.x) / scale) * R,
((top + (flipY ? -position.y : position.y)) / scale) * R
);
}