@dra2020/baseclient 1.0.30 → 1.0.33
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 +18 -4
- package/dist/baseclient.js.map +1 -1
- package/dist/ot-js/otsession.d.ts +2 -1
- package/lib/geo/geo.ts +5 -0
- package/lib/ot-js/otsession.ts +2 -1
- package/lib/poly/pointinpoly.ts +15 -4
- package/package.json +1 -1
package/dist/baseclient.js
CHANGED
|
@@ -1359,6 +1359,10 @@ function geoEnsureID(col) {
|
|
|
1359
1359
|
prop = p; });
|
|
1360
1360
|
if (prop)
|
|
1361
1361
|
col.features.forEach(f => { f.properties.id = f.properties[prop]; });
|
|
1362
|
+
else {
|
|
1363
|
+
let n = 1;
|
|
1364
|
+
col.features.forEach(f => { f.properties.id = String(n++); });
|
|
1365
|
+
}
|
|
1362
1366
|
}
|
|
1363
1367
|
}
|
|
1364
1368
|
exports.geoEnsureID = geoEnsureID;
|
|
@@ -5880,9 +5884,19 @@ function polyContainsPoint(poly, x, y) {
|
|
|
5880
5884
|
return false;
|
|
5881
5885
|
let bFound = false;
|
|
5882
5886
|
let bInside = false;
|
|
5887
|
+
let iCurPoly = -1;
|
|
5888
|
+
let bCurInside = false;
|
|
5883
5889
|
PP.polyPackEachRing(pp, (b, iPoly, iRing, iOffset, nPoints) => {
|
|
5884
5890
|
if (bFound)
|
|
5885
5891
|
return;
|
|
5892
|
+
if (iRing == 0) {
|
|
5893
|
+
if (iCurPoly >= 0 && bCurInside) {
|
|
5894
|
+
bInside = true;
|
|
5895
|
+
bFound = true;
|
|
5896
|
+
}
|
|
5897
|
+
iCurPoly = iPoly;
|
|
5898
|
+
bCurInside = false;
|
|
5899
|
+
}
|
|
5886
5900
|
let inside = false;
|
|
5887
5901
|
let iEnd = iOffset + (nPoints - 1) * 2;
|
|
5888
5902
|
for (let i = iOffset, j = iEnd; i <= iEnd; j = i, i += 2) {
|
|
@@ -5893,11 +5907,11 @@ function polyContainsPoint(poly, x, y) {
|
|
|
5893
5907
|
if (intersect)
|
|
5894
5908
|
inside = !inside;
|
|
5895
5909
|
}
|
|
5896
|
-
if (inside)
|
|
5897
|
-
|
|
5898
|
-
bInside = iRing == 0; // not inside if inside a hole
|
|
5899
|
-
}
|
|
5910
|
+
if (inside)
|
|
5911
|
+
bCurInside = iRing == 0; // not inside if inside a hole
|
|
5900
5912
|
});
|
|
5913
|
+
if (iCurPoly >= 0 && bCurInside)
|
|
5914
|
+
bInside = true;
|
|
5901
5915
|
return bInside;
|
|
5902
5916
|
}
|
|
5903
5917
|
exports.polyContainsPoint = polyContainsPoint;
|