stac-layer
Version:
Visualize a STAC Item or Collection on a Leaflet Map
13 lines (12 loc) • 348 B
JavaScript
/**
*
* @param {Number[]} bbox
* @description convert bounding box in format [xmin, ymin, xmax, ymax] to Leaflet Bounds
* @returns
*/
export default function bboxToLatLngBounds(bbox) {
const [xmin, ymin, xmax, ymax] = bbox;
const southWest = [ymin, xmin];
const northEast = [ymax, xmax];
return L.latLngBounds(southWest, northEast);
}