Skip to content

Commit

Permalink
fix: replace wgs84ToWindowCoordinates #27
Browse files Browse the repository at this point in the history
  • Loading branch information
hongfaqiu committed Sep 6, 2024
1 parent 72fc294 commit 0d7b68a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
5 changes: 3 additions & 2 deletions packages/measure/src/AreaSurfaceMeasure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,9 @@ class AreaSurfaceMeasure extends AreaMeasure {
*/
getArea(positions: Cartesian3[]): number {
return this._calculateSurfaceArea(
positions.map((item) =>
SceneTransforms.wgs84ToWindowCoordinates(this._viewer.scene, item),
positions.map(
(item) =>
SceneTransforms.worldToWindowCoordinates(this._viewer.scene, item)!,
),
);
}
Expand Down
8 changes: 4 additions & 4 deletions packages/measure/src/DistanceSurfaceMeasure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,14 @@ class DistanceSurfaceMeasure extends DistanceMeasure {
}

getDistance(pos1: Cartesian3, pos2: Cartesian3): number {
const start = SceneTransforms.wgs84ToWindowCoordinates(
const start = SceneTransforms.worldToWindowCoordinates(
this._viewer.scene,
pos1,
);
const end = SceneTransforms.wgs84ToWindowCoordinates(
)!;
const end = SceneTransforms.worldToWindowCoordinates(
this._viewer.scene,
pos2,
);
)!;

return this._calculateSurfaceDistance(start, end);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/popup/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export default class Popup {
}
}

const screenPosition = SceneTransforms.wgs84ToWindowCoordinates(
const screenPosition = SceneTransforms.worldToWindowCoordinates(
this._viewer.scene,
this._position,
);
Expand Down

0 comments on commit 0d7b68a

Please sign in to comment.