@dra2020/baseclient 1.0.31 → 1.0.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/baseclient.js +15 -5
- package/dist/baseclient.js.map +1 -1
- package/dist/ot-js/otsession.d.ts +2 -1
- package/lib/ot-js/otsession.ts +2 -1
- package/lib/poly/pointinpoly.ts +15 -4
- package/lib/poly/polypack.ts +1 -1
- package/package.json +1 -1
package/lib/ot-js/otsession.ts
CHANGED
package/lib/poly/pointinpoly.ts
CHANGED
|
@@ -6,9 +6,21 @@ export function polyContainsPoint(poly: any, x: number, y: number): boolean
|
|
|
6
6
|
if (pp == null) return false;
|
|
7
7
|
let bFound = false;
|
|
8
8
|
let bInside = false;
|
|
9
|
+
let iCurPoly = -1;
|
|
10
|
+
let bCurInside = false;
|
|
9
11
|
|
|
10
12
|
PP.polyPackEachRing(pp, (b: Float64Array, iPoly: number, iRing: number, iOffset: number, nPoints: number) => {
|
|
11
13
|
if (bFound) return;
|
|
14
|
+
if (iRing == 0)
|
|
15
|
+
{
|
|
16
|
+
if (iCurPoly >= 0 && bCurInside)
|
|
17
|
+
{
|
|
18
|
+
bInside = true;
|
|
19
|
+
bFound = true;
|
|
20
|
+
}
|
|
21
|
+
iCurPoly = iPoly;
|
|
22
|
+
bCurInside = false;
|
|
23
|
+
}
|
|
12
24
|
let inside = false;
|
|
13
25
|
let iEnd = iOffset + (nPoints - 1) * 2;
|
|
14
26
|
for (let i = iOffset, j = iEnd; i <= iEnd; j = i, i += 2)
|
|
@@ -20,10 +32,9 @@ export function polyContainsPoint(poly: any, x: number, y: number): boolean
|
|
|
20
32
|
if (intersect) inside = !inside;
|
|
21
33
|
}
|
|
22
34
|
if (inside)
|
|
23
|
-
|
|
24
|
-
bFound = iRing > 0; // if inside a hole, don't need to process further
|
|
25
|
-
bInside = iRing == 0; // not inside if inside a hole
|
|
26
|
-
}
|
|
35
|
+
bCurInside = iRing == 0; // not inside if inside a hole
|
|
27
36
|
});
|
|
37
|
+
if (iCurPoly >= 0 && bCurInside)
|
|
38
|
+
bInside = true;
|
|
28
39
|
return bInside;
|
|
29
40
|
}
|
package/lib/poly/polypack.ts
CHANGED
|
@@ -349,7 +349,7 @@ export function featurePack(f: any, prepack?: PolyPack): any
|
|
|
349
349
|
}
|
|
350
350
|
return f.geometry.packed;
|
|
351
351
|
}
|
|
352
|
-
else if (f
|
|
352
|
+
else if (f && f.type === 'FeatureCollection' && f.features)
|
|
353
353
|
{
|
|
354
354
|
// Allocate one large buffer
|
|
355
355
|
let nFloats: number = 0;
|