canNotReachRect = {
var tmp,
{ minLongitude, maxLongitude, minLatitude, maxLatitude } =
canNotReachRectSetup;
if (minLatitude > maxLatitude) {
tmp = maxLatitude;
maxLatitude = minLatitude;
minLatitude = tmp;
}
if (minLongitude > maxLongitude) {
tmp = maxLongitude;
maxLongitude = minLongitude;
minLongitude = tmp;
}
const polygon = [
[minLongitude, maxLatitude],
[maxLongitude, maxLatitude],
[maxLongitude, minLatitude],
[minLongitude, minLatitude],
[minLongitude, maxLatitude]
],
canNotReachGeometry = {
type: "FeatureCollection",
features: [
{
type: "Feature",
properties: {},
geometry: {
type: "MultiPolygon",
coordinates: [[polygon]]
}
}
]
};
canNotReachGeometry.insideMe = (pnt) => {
return d3.polygonContains(polygon, [pnt.longitude, pnt.latitude]);
};
return canNotReachGeometry;
}