Skip to main content

QuerySource

A feed that is asked only for the features inside the current view, for a dataset too large to fetch whole. The layer requests again, after the map has settled, each time the view leaves the area last loaded.

This is an interface exported by @mapcairn/core, checked against version 0.2.0.

Signature​

import type { QuerySource } from "@mapcairn/core";

interface QuerySource

Properties​

decoder​

readonly decoder: string;

The name of the registered decoder that reads the response.

fields​

readonly fields: FieldMap;

Where each decoded field is read from in a raw feature.

filter​

readonly filter?: FeatureFilter;

Drops features that do not match, before they are drawn or listed.

kind​

readonly kind: "query";

Tells a query from a feed.

maxFeatures​

readonly maxFeatures: number;

The most features drawn at once, 1 to 5000.

minzoom​

readonly minzoom?: number;

Nothing is requested below this normalised zoom; the layer says to zoom in.

url​

readonly url: string;

A URL template over the view's box and the control values.

Remarks​

url must use {west}, {south}, {east} and {north} (a box in decimal degrees) and may use {limit}, which is maxFeatures plus one so the response shows when more exist. Beyond maxFeatures the layer draws the first ones and says to zoom in.

See also​

Source: packages/core/src/layers/definition.ts:274