@dra2020/baseclient 1.0.100 → 1.0.101
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 +4 -0
- package/dist/baseclient.js.map +1 -1
- package/lib/poly/polypack.ts +3 -0
- package/package.json +1 -1
package/lib/poly/polypack.ts
CHANGED
|
@@ -21,6 +21,7 @@ export function polyPackSize(coords: any): number
|
|
|
21
21
|
// Null feature?
|
|
22
22
|
if (coords == null || (coords.length !== undefined && coords.length == 0)) return 0;
|
|
23
23
|
|
|
24
|
+
if (! Array.isArray(coords)) return 0;
|
|
24
25
|
let depth = Util.depthof(coords);
|
|
25
26
|
if (depth == 3) coords = [[ coords ]];
|
|
26
27
|
else if (depth == 4) coords = [ coords ]; // normalize to multipolygon
|
|
@@ -223,6 +224,8 @@ export function polyPack(coords: any, prepack?: PolyPack): PolyPack
|
|
|
223
224
|
coords = coords.geometry.coordinates;
|
|
224
225
|
|
|
225
226
|
// Transparently handle polygon or multi-polygon
|
|
227
|
+
if (! Array.isArray(coords)) return null;
|
|
228
|
+
|
|
226
229
|
let depth = Util.depthof(coords);
|
|
227
230
|
if (depth == 2) coords = [ [ [ coords ] ] ];
|
|
228
231
|
else if (depth == 3) coords = [ [ coords ] ];
|