#2462·turf

isMultiPointInPoly variables oneInside is never used

Author: qugemingzizhemefeijinCreated Jul 30, 2023Updated May 13, 2026
Labels@turf/boolean-within

turf/packages/turf-boolean-within /index.ts

The following code:

javascript
function isMultiPointInPoly(multiPoint: MultiPoint, polygon: Polygon) {
  var output = true;
  var oneInside = false;
  var isInside = false;
  for (var i = 0; i < multiPoint.coordinates.length; i++) {
    isInside = booleanPointInPolygon(multiPoint.coordinates[i], polygon);
    if (!isInside) {
      output = false;
      break;
    }
    if (!oneInside) {
      // this variables Should be oneInside ???
      isInside = booleanPointInPolygon(multiPoint.coordinates[i], polygon, {
        ignoreBoundary: true,
      });
    }
  }
  return output && isInside;
}

this code variable oneInside Whether it is not used。