@lumikmz/kmz-file 0.7.1 → 0.8.0
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/index.mjs +18 -6
- package/dist/wasm_kmz_bg.wasm +0 -0
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -322,7 +322,7 @@ function encodeActionParams(action) {
|
|
|
322
322
|
return {
|
|
323
323
|
"wpml:payloadPositionIndex": String(p.payloadPositionIndex),
|
|
324
324
|
"wpml:useGlobalPayloadLensIndex": formatBool(p.useGlobalPayloadLensIndex),
|
|
325
|
-
"wpml:payloadLensIndex": p.payloadLensIndex,
|
|
325
|
+
"wpml:payloadLensIndex": formatLensList(p.payloadLensIndex),
|
|
326
326
|
"wpml:minShootInterval": String(p.minShootInterval)
|
|
327
327
|
};
|
|
328
328
|
}
|
|
@@ -330,7 +330,7 @@ function encodeActionParams(action) {
|
|
|
330
330
|
const p = a.actionActuatorFuncParam;
|
|
331
331
|
return {
|
|
332
332
|
"wpml:payloadPositionIndex": String(p.payloadPositionIndex),
|
|
333
|
-
"wpml:payloadLensIndex": p.payloadLensIndex
|
|
333
|
+
"wpml:payloadLensIndex": formatLensList(p.payloadLensIndex)
|
|
334
334
|
};
|
|
335
335
|
}
|
|
336
336
|
case "gimbalAngleLock": {
|
|
@@ -524,11 +524,13 @@ function encodeMappingStripPlacemark(p) {
|
|
|
524
524
|
return {
|
|
525
525
|
LineString: { coordinates: p.LineString.coordinates },
|
|
526
526
|
"wpml:caliFlightEnable": formatBool(p.caliFlightEnable),
|
|
527
|
+
...p.elevationOptimizeEnable !== void 0 ? { "wpml:elevationOptimizeEnable": formatBool(p.elevationOptimizeEnable) } : {},
|
|
527
528
|
"wpml:shootType": p.shootType,
|
|
528
529
|
"wpml:direction": String(p.direction),
|
|
529
530
|
"wpml:margin": String(p.margin),
|
|
530
531
|
"wpml:singleLineEnable": formatBool(p.singleLineEnable),
|
|
531
532
|
"wpml:cuttingDistance": String(p.cuttingDistance),
|
|
533
|
+
...p.stripMergedRegions !== void 0 ? { "wpml:stripMergedRegions": JSON.stringify(p.stripMergedRegions) } : {},
|
|
532
534
|
"wpml:boundaryOptimEnable": formatBool(p.boundaryOptimEnable),
|
|
533
535
|
"wpml:leftExtend": String(p.leftExtend),
|
|
534
536
|
"wpml:rightExtend": String(p.rightExtend),
|
|
@@ -925,7 +927,7 @@ function decodeAction(raw) {
|
|
|
925
927
|
actionActuatorFuncParam: {
|
|
926
928
|
payloadPositionIndex: parseNum(p["wpml:payloadPositionIndex"], "payloadPositionIndex"),
|
|
927
929
|
useGlobalPayloadLensIndex: parseBool(p["wpml:useGlobalPayloadLensIndex"], "useGlobalPayloadLensIndex"),
|
|
928
|
-
payloadLensIndex:
|
|
930
|
+
payloadLensIndex: parseLensList(p["wpml:payloadLensIndex"]),
|
|
929
931
|
minShootInterval: parseNum(p["wpml:minShootInterval"], "minShootInterval")
|
|
930
932
|
}
|
|
931
933
|
};
|
|
@@ -934,7 +936,7 @@ function decodeAction(raw) {
|
|
|
934
936
|
actionActuatorFunc: "stopTimeLapse",
|
|
935
937
|
actionActuatorFuncParam: {
|
|
936
938
|
payloadPositionIndex: parseNum(p["wpml:payloadPositionIndex"], "payloadPositionIndex"),
|
|
937
|
-
payloadLensIndex:
|
|
939
|
+
payloadLensIndex: parseLensList(p["wpml:payloadLensIndex"])
|
|
938
940
|
}
|
|
939
941
|
};
|
|
940
942
|
case "gimbalAngleLock": return {
|
|
@@ -1125,19 +1127,29 @@ function decodeMapping3dPlacemark(p) {
|
|
|
1125
1127
|
};
|
|
1126
1128
|
}
|
|
1127
1129
|
function decodeMappingStripPlacemark(p) {
|
|
1130
|
+
let stripMergedRegions;
|
|
1131
|
+
if (p["wpml:stripMergedRegions"] !== void 0) try {
|
|
1132
|
+
const parsed = JSON.parse(p["wpml:stripMergedRegions"]);
|
|
1133
|
+
if (!Array.isArray(parsed) || !parsed.every((group) => Array.isArray(group) && group.every((value) => Number.isInteger(value)))) throw new Error("expected integer[][]");
|
|
1134
|
+
stripMergedRegions = parsed;
|
|
1135
|
+
} catch {
|
|
1136
|
+
throw new KmzError(`Invalid wpml:stripMergedRegions: "${p["wpml:stripMergedRegions"]}"`);
|
|
1137
|
+
}
|
|
1128
1138
|
return {
|
|
1129
1139
|
caliFlightEnable: parseBool(p["wpml:caliFlightEnable"], "caliFlightEnable"),
|
|
1140
|
+
...p["wpml:elevationOptimizeEnable"] !== void 0 ? { elevationOptimizeEnable: parseBool(p["wpml:elevationOptimizeEnable"], "elevationOptimizeEnable") } : {},
|
|
1130
1141
|
shootType: p["wpml:shootType"],
|
|
1131
1142
|
direction: degrees(parseNum(p["wpml:direction"], "direction")),
|
|
1132
|
-
margin: parseNum(p["wpml:margin"], "margin"),
|
|
1143
|
+
margin: p["wpml:margin"] == null ? 0 : parseNum(p["wpml:margin"], "margin"),
|
|
1133
1144
|
singleLineEnable: parseBool(p["wpml:singleLineEnable"], "singleLineEnable"),
|
|
1134
1145
|
cuttingDistance: parseNum(p["wpml:cuttingDistance"], "cuttingDistance"),
|
|
1146
|
+
...stripMergedRegions !== void 0 ? { stripMergedRegions } : {},
|
|
1135
1147
|
boundaryOptimEnable: parseBool(p["wpml:boundaryOptimEnable"], "boundaryOptimEnable"),
|
|
1136
1148
|
leftExtend: parseNum(p["wpml:leftExtend"], "leftExtend"),
|
|
1137
1149
|
rightExtend: parseNum(p["wpml:rightExtend"], "rightExtend"),
|
|
1138
1150
|
includeCenterEnable: parseBool(p["wpml:includeCenterEnable"], "includeCenterEnable"),
|
|
1139
1151
|
overlap: decodeOverlap(p["wpml:overlap"]),
|
|
1140
|
-
LineString: { coordinates: p.LineString.coordinates },
|
|
1152
|
+
LineString: { coordinates: p.LineString.coordinates ?? "" },
|
|
1141
1153
|
ellipsoidHeight: meters(parseNum(p["wpml:ellipsoidHeight"], "ellipsoidHeight")),
|
|
1142
1154
|
height: meters(parseNum(p["wpml:height"], "height")),
|
|
1143
1155
|
stripUseTemplateAltitude: parseBool(p["wpml:stripUseTemplateAltitude"], "stripUseTemplateAltitude")
|
package/dist/wasm_kmz_bg.wasm
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lumikmz/kmz-file",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "DJI KMZ file pack/unpack — Rust WASM + spec-aligned TypeScript codec",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"./package.json": "./package.json"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@lumikmz/kmz": "0.
|
|
27
|
+
"@lumikmz/kmz": "0.8.0"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"vite-plus": "latest",
|