From 79508d7028f9928d2f9c29d579d910aebe750942 Mon Sep 17 00:00:00 2001 From: liqikun Date: Fri, 24 May 2024 17:49:41 +0800 Subject: [PATCH] fix: createGeometryFromData Polygon --- src/polygon/polygon.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/polygon/polygon.ts b/src/polygon/polygon.ts index 3d447b5..2726caa 100644 --- a/src/polygon/polygon.ts +++ b/src/polygon/polygon.ts @@ -51,6 +51,13 @@ export default class Polygon extends Base { this.drawPolygon(); } + createGraphic(positions: Cartesian3[]) { + const lnglatPoints = positions.map(this.cartesianToLnglat); + const coords = lnglatPoints.flat(); + const cartesianPoints = this.cesium.Cartesian3.fromDegreesArray(coords); + return cartesianPoints; + } + getPoints() { return this.points; }