@dra2020/baseclient 1.0.116 → 1.0.117
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/baseclient.js +17 -0
- package/dist/baseclient.js.map +1 -1
- package/lib/poly/polypack.ts +18 -0
- package/package.json +1 -1
package/dist/baseclient.js
CHANGED
|
@@ -8903,6 +8903,23 @@ function featurePack(f, prepack) {
|
|
|
8903
8903
|
return f.geometry.packed;
|
|
8904
8904
|
}
|
|
8905
8905
|
else if (f && f.type === 'FeatureCollection' && f.features) {
|
|
8906
|
+
// Empty?
|
|
8907
|
+
if (f.features.length == 0)
|
|
8908
|
+
return f;
|
|
8909
|
+
// Already packed or packed incorrectly?
|
|
8910
|
+
let ff = f.features[0];
|
|
8911
|
+
if (ff && ff.geometry && ff.geometry.packed) {
|
|
8912
|
+
// Already packed
|
|
8913
|
+
if (ArrayBuffer.isView(ff.geometry.packed.buffer))
|
|
8914
|
+
return f;
|
|
8915
|
+
// Improperly packed (buffer converted to object - convert back to buffer
|
|
8916
|
+
let o = ff.geometry.packed.buffer;
|
|
8917
|
+
let b = new Float64Array(Util.countKeys(o));
|
|
8918
|
+
for (const i in o)
|
|
8919
|
+
b[Number(i)] = o[i];
|
|
8920
|
+
f.features.forEach((ff) => ff.geometry.packed.buffer = b);
|
|
8921
|
+
return f;
|
|
8922
|
+
}
|
|
8906
8923
|
// Allocate one large buffer
|
|
8907
8924
|
let nFloats = 0;
|
|
8908
8925
|
let i;
|