Retrospective guide for @un-fao/visualization@0.1.0-review.0. Read Start here for matching dependencies and limitations.
This layer discovers entries from a supported STAC Collection or ItemCollection
and renders one selected raster through SingleBandRasterLayer. It is not a
mosaic of all entries and does not provide a selector widget.
import { DataViewport, SingleBandRasterCollectionLayer } from '@un-fao/visualization';
import type { RasterCollectionSourceInput } from '@un-fao/visualization';
export function CollectionExample({ source }: { source: RasterCollectionSourceInput }) {
const layer = new SingleBandRasterCollectionLayer({
id: 'legacy-collection',
source,
selectedEntryIndex: 0,
maxItems: 20,
maxPages: 2,
displayMin: 0,
displayMax: 1,
});
return (
<div style={{ position: 'relative', width: '100%', height: 400 }}>
<DataViewport
initialViewState={{ longitude: 12.5, latitude: 41.9, zoom: 6 }}
controller={true}
layers={[layer]}
/>
</div>
);
}
| Module | Import | Purpose | Why or when |
|---|---|---|---|
@un-fao/visualization |
DataViewport |
Runtime-required | Hosts the selected raster in this example. |
@un-fao/visualization |
SingleBandRasterCollectionLayer |
Runtime-required | Discovers entries and constructs the selected raster layer. |
@un-fao/visualization |
RasterCollectionSourceInput |
Optional type-only | Annotates the caller-supplied source; it adds no runtime discovery behavior. |
Pass a source matching RasterCollectionSourceInput, with browser access to both catalogue and assets. The camera and range must fit the dataset; the values above are examples, not defaults.
selectedEntryId or selectedEntryIndex expresses selection. pageSize,
maxItems, maxPages and limitPolicy bound discovery. Use
onCollectionResolved for inventory and onSelectionResolved for selection
results when building controls. onLegendResolved and onLoad report
selected-raster results. No date-navigation widget is supplied.
See SingleBandRasterCollectionLayer,
SingleBandRasterCollectionLayerProps, RasterCollectionInfo and
RasterCollectionSelection for the exact .0 API and output shapes.