Skip to main content

resolveControlValues

A full set of control values from partial, untrusted ones (a permalink, a change in the ui): values a control accepts are kept, a date outside its bounds is moved to the nearest bound (a date and time also rounded down to its step), anything else becomes the default, and values for controls the layer lacks are dropped.

This is a function exported by @mapcairn/core, checked against version 0.2.0.

Signature​

import { resolveControlValues } from "@mapcairn/core";

function resolveControlValues(definition: LayerDefinition, values: Readonly<Record<string, string>> | undefined, now: number): ControlValues;

Parameters​

  • definition (LayerDefinition)
  • values (Readonly<Record<string, string>> | undefined)
  • now (number)

Returns​

ControlValues

See also​

Source: packages/core/src/layers/controls.ts:148