Include mpu in point resolution calculations
This commit is contained in:
@@ -43,18 +43,13 @@ function onChangeProjection() {
|
|||||||
const currentCenter = currentView.getCenter();
|
const currentCenter = currentView.getCenter();
|
||||||
const currentRotation = currentView.getRotation();
|
const currentRotation = currentView.getRotation();
|
||||||
const newCenter = transform(currentCenter, currentProjection, newProjection);
|
const newCenter = transform(currentCenter, currentProjection, newProjection);
|
||||||
const currentPointResolution = getPointResolution(
|
const currentMPU = currentProjection.getMetersPerUnit();
|
||||||
currentProjection,
|
const newMPU = newProjection.getMetersPerUnit();
|
||||||
1,
|
const currentPointResolution =
|
||||||
currentCenter,
|
getPointResolution(currentProjection, 1 / currentMPU, currentCenter, 'm') *
|
||||||
'm'
|
currentMPU;
|
||||||
);
|
const newPointResolution =
|
||||||
const newPointResolution = getPointResolution(
|
getPointResolution(newProjection, 1 / newMPU, newCenter, 'm') * newMPU;
|
||||||
newProjection,
|
|
||||||
1,
|
|
||||||
newCenter,
|
|
||||||
'm'
|
|
||||||
);
|
|
||||||
const newResolution =
|
const newResolution =
|
||||||
(currentResolution * currentPointResolution) / newPointResolution;
|
(currentResolution * currentPointResolution) / newPointResolution;
|
||||||
const newView = new View({
|
const newView = new View({
|
||||||
|
|||||||
Reference in New Issue
Block a user