mirror of
https://github.com/ethan-zf/cesium-plot-js.git
synced 2025-06-23 19:17:29 +00:00
fix: createGeometryFromData Polygon
This commit is contained in:
parent
4139d7d74a
commit
a9d0534b8a
@ -870,6 +870,7 @@ export default class Base {
|
||||
|
||||
createGraphic(points: CesiumTypeOnly.Cartesian3[]): CesiumTypeOnly.Cartesian3[] {
|
||||
//Abstract method that must be implemented by subclasses.
|
||||
return [new this.cesium.Cartesian3()];
|
||||
// return [new this.cesium.Cartesian3()];
|
||||
return points;
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user