function testCircleGeoPolygon(circle, geopolygon) {
  if (circleHasNoSize(circle)) {
    return false;
  }
  const center = { x: circle.cx, y: circle.cy };
  if (testGeoPolygonPoint(geopolygon, center)) {
    return true;
  }
  const { numPolygons, polygons } = geopolygon;
  for (let n = 0; n < numPolygons; n++) {
    const polygon = polygons[n];
    const num = polygon.edges.length;
    for (let i = 0; i < num; i++) {
      const edge = pointsToLine(polygon.edges[i]);
      if (testCircleLine(circle, edge)) {
        return true;
      }
    }
  }
  return false;
}
/**
 * Test if a Circle collide with GeoPolygon. If so, returns true and false otherwise.
 * Circle muse have a radius greater then 0.
 * @private
 * @param {object} circle
 * @param {number} circle.cx - center x-coordinate
 * @param {number} circle.cy - center y-coordinate
 * @param {number} circle.r - circle radius
 * @param {object} geopolygon
 * @param {Array} geopolygon.polygons - Array of polygons
 * @return {boolean} true if circle collide with polygon
 */
Test if a Circle collide with GeoPolygon. If so, returns true and false otherwise.
Circle muse have a radius greater then 0.
Test if a Circle collide with GeoPolygon . If so returns true and false otherwise . Circle muse have a radius greater then 0 .
function testCircleGeoPolygon(circle, geopolygon) {
  if (circleHasNoSize(circle)) {
    return false;
  }
  const center = { x: circle.cx, y: circle.cy };
  if (testGeoPolygonPoint(geopolygon, center)) {
    return true;
  }
  const { numPolygons, polygons } = geopolygon;
  for (let n = 0; n < numPolygons; n++) {
    const polygon = polygons[n];
    const num = polygon.edges.length;
    for (let i = 0; i < num; i++) {
      const edge = pointsToLine(polygon.edges[i]);
      if (testCircleLine(circle, edge)) {
        return true;
      }
    }
  }
  return false;
}
function testCircleGeoPolygon ( circle , geopolygon ) { if ( circleHasNoSize ( circle ) ) { return false ; } const center = { x : circle . cx , y : circle . cy } ; if ( testGeoPolygonPoint ( geopolygon , center ) ) { return true ; } const { numPolygons , polygons } = geopolygon ; for ( let n = 0 ; n < numPolygons ; n ++ ) { const polygon = polygons [ n ] ; const num = polygon . edges . length ; for ( let i = 0 ; i < num ; i ++ ) { const edge = pointsToLine ( polygon . edges [ i ] ) ; if ( testCircleLine ( circle , edge ) ) { return true ; } } } return false ; }
Test if a Circle collide with GeoPolygon.
Test if a Circle collide with GeoPolygon .