I'm trying to move a client side method on the backend:
The client side method is using TurfJS and Leaflet to perform some operations. The only problem is that server side (nodejs) window is not available, hence I cannot use Leaflet.
I'm looking for a way to transform this piece of code in the vanilla Turf equivalent:
const pointA = turf.point([originCoords.lng, originCoords.lat]);
const pointB = turf.destination.default(pointA, 50, 45, { units: 'kilometers' });
// here I'm using leaflet to get a BBox
const latLngBounds = L.latLngBounds(
L.latLng(pointA.geometry.coordinates[1],
pointA.geometry.coordinates[0]),
L.latLng(pointB.geometry.coordinates[1], pointB.geometry.coordinates[0]),
);
// using that BBox I then create the rectangle, again with leaflet
tile = L.rectangle(latLngBounds);
I'm still newbie with this whole GeoJSON thing, and maybe I'm missing something, can someone help me?