@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.
@@ -5884,9 +5884,19 @@ function polyContainsPoint(poly, x, y) {
5884
5884
  return false;
5885
5885
  let bFound = false;
5886
5886
  let bInside = false;
5887
+ let iCurPoly = -1;
5888
+ let bCurInside = false;
5887
5889
  PP.polyPackEachRing(pp, (b, iPoly, iRing, iOffset, nPoints) => {
5888
5890
  if (bFound)
5889
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
+ }
5890
5900
  let inside = false;
5891
5901
  let iEnd = iOffset + (nPoints - 1) * 2;
5892
5902
  for (let i = iOffset, j = iEnd; i <= iEnd; j = i, i += 2) {
@@ -5897,11 +5907,11 @@ function polyContainsPoint(poly, x, y) {
5897
5907
  if (intersect)
5898
5908
  inside = !inside;
5899
5909
  }
5900
- if (inside) {
5901
- bFound = iRing > 0; // if inside a hole, don't need to process further
5902
- bInside = iRing == 0; // not inside if inside a hole
5903
- }
5910
+ if (inside)
5911
+ bCurInside = iRing == 0; // not inside if inside a hole
5904
5912
  });
5913
+ if (iCurPoly >= 0 && bCurInside)
5914
+ bInside = true;
5905
5915
  return bInside;
5906
5916
  }
5907
5917
  exports.polyContainsPoint = polyContainsPoint;
@@ -7304,7 +7314,7 @@ function featurePack(f, prepack) {
7304
7314
  }
7305
7315
  return f.geometry.packed;
7306
7316
  }
7307
- else if (f.type && f.type === 'FeatureCollection' && f.features) {
7317
+ else if (f && f.type === 'FeatureCollection' && f.features) {
7308
7318
  // Allocate one large buffer
7309
7319
  let nFloats = 0;
7310
7320
  let i;