inBoundingBox method

bool inBoundingBox(
  1. GeoPoint point
)

Implementation

bool inBoundingBox(GeoPoint point) {
  bool latMatch = false;
  bool lonMatch = false;
  if (north < south) {
    latMatch = true;
  } else {
    latMatch = (point.latitude < north) && (point.latitude > south);
  }
  if (east < west) {
    lonMatch = point.longitude <= east && point.longitude >= west;
  } else {
    lonMatch = point.longitude < east && point.longitude > west;
  }

  return lonMatch && latMatch;
}