Correct cast of Projection in Geometry.transform
This commit is contained in:
@@ -235,11 +235,12 @@ class Geometry extends BaseObject {
|
|||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
transform(source, destination) {
|
transform(source, destination) {
|
||||||
source = getProjection(source);
|
/** @type {import("../proj/Projection.js").default} */
|
||||||
const transformFn = source.getUnits() == Units.TILE_PIXELS ?
|
const sourceProj = getProjection(source);
|
||||||
|
const transformFn = sourceProj.getUnits() == Units.TILE_PIXELS ?
|
||||||
function(inCoordinates, outCoordinates, stride) {
|
function(inCoordinates, outCoordinates, stride) {
|
||||||
const pixelExtent = source.getExtent();
|
const pixelExtent = sourceProj.getExtent();
|
||||||
const projectedExtent = source.getWorldExtent();
|
const projectedExtent = sourceProj.getWorldExtent();
|
||||||
const scale = getHeight(projectedExtent) / getHeight(pixelExtent);
|
const scale = getHeight(projectedExtent) / getHeight(pixelExtent);
|
||||||
composeTransform(tmpTransform,
|
composeTransform(tmpTransform,
|
||||||
projectedExtent[0], projectedExtent[3],
|
projectedExtent[0], projectedExtent[3],
|
||||||
|
|||||||
Reference in New Issue
Block a user