decodeFeed
Decodes a feed response with the definition's decoder, applies its filter
and keeps the geometry the layer draws: points for a point style or a
heatmap, polygons for an area style and lines for a line style. A query
layer keeps at most one feature more than its maxFeatures, so the caller
can tell that more exist without holding a runaway response.
This is a function exported by @mapcairn/core, checked against version 0.2.0.
Signature
import { decodeFeed } from "@mapcairn/core";
function decodeFeed(definition: LayerDefinition, raw: unknown, decoders: DecoderRegistry): LayerFeature[];
Parameters
definition(LayerDefinition)raw(unknown)decoders(DecoderRegistry)
Returns
LayerFeature[]
Throws
LayerErrorinvalidwhen it cannot be decoded (or the layer has no feed), andemptywhen no feature is left.