# 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

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

## Properties

### decoder

```ts
readonly decoder: string;
```

The name of the registered decoder that reads the response.

### fields

```ts
readonly fields: FieldMap;
```

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

### filter

```ts
readonly filter?: FeatureFilter;
```

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

### kind

```ts
readonly kind: "query";
```

Tells a query from a feed.

### maxFeatures

```ts
readonly maxFeatures: number;
```

The most features drawn at once, 1 to 5000.

### minzoom

```ts
readonly minzoom?: number;
```

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

### url

```ts
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

- [`FieldMap`](https://docs.mapcairn.com/api/core/FieldMap.md)
- [`FeatureFilter`](https://docs.mapcairn.com/api/core/FeatureFilter.md)

Source: [packages/core/src/layers/definition.ts:274](https://github.com/MapCairn/mapcairn/blob/main/packages/core/src/layers/definition.ts#L274)
