Skip to main content

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​

  • LayerError invalid when it cannot be decoded (or the layer has no feed), and empty when no feature is left.

See also​

Source: packages/core/src/layers/feed.ts:37