@jorgmoritz/gis-manager 0.1.32 → 0.1.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/vue/index.js CHANGED
@@ -8133,7 +8133,7 @@ var PolygonEditor = class {
8133
8133
  if (!polygon) return [];
8134
8134
  const hierarchy = typeof polygon.hierarchy?.getValue === "function" ? polygon.hierarchy.getValue(C.JulianDate.now()) : polygon.hierarchy;
8135
8135
  const positions = hierarchy?.positions ?? hierarchy ?? [];
8136
- return positions.map((cartesian) => {
8136
+ const points = positions.map((cartesian) => {
8137
8137
  const cartographic = C.Cartographic.fromCartesian(cartesian);
8138
8138
  return {
8139
8139
  lon: C.Math.toDegrees(cartographic.longitude),
@@ -8141,6 +8141,14 @@ var PolygonEditor = class {
8141
8141
  height: cartographic.height
8142
8142
  };
8143
8143
  });
8144
+ if (points.length > 0) {
8145
+ const first = points[0];
8146
+ const last = points[points.length - 1];
8147
+ if (first.lon !== last.lon || first.lat !== last.lat || first.height !== last.height) {
8148
+ points.push({ ...first });
8149
+ }
8150
+ }
8151
+ return points;
8144
8152
  }
8145
8153
  /**
8146
8154
  * 辅助方法:获取实体所属的 DataSource
@@ -10266,7 +10274,15 @@ var CZMLManager = class {
10266
10274
  const hProp = entity.polygon.hierarchy;
10267
10275
  const hVal = typeof hProp?.getValue === "function" ? hProp.getValue(now) : hProp;
10268
10276
  const outer = Array.isArray(hVal) ? hVal : hVal?.positions ?? [];
10269
- return outer.map(toLonLatHeight);
10277
+ const points = outer.map(toLonLatHeight);
10278
+ if (points.length > 0) {
10279
+ const first = points[0];
10280
+ const last = points[points.length - 1];
10281
+ if (first.lon !== last.lon || first.lat !== last.lat || first.height !== last.height) {
10282
+ points.push({ ...first });
10283
+ }
10284
+ }
10285
+ return points;
10270
10286
  }
10271
10287
  if (entity?.polyline?.positions) {
10272
10288
  const pProp = entity.polyline.positions;