Open Forms TS types
    Preparing search index...

    Interface MapComponentSchema

    Component shape/options for the map component.

    The map displays a geographic map of (a part of) the Netherlands, typically using the tile layer(s) from PDOK. The coorindate system is fixed to the Dutch CRS - Rijksdriehoek.

    Users can draw geometries on the map, which become the input value for the component in the submission. They are always GeoJSON.

    Map components do not have default values.

    The generated documentation might be slightly off due to rendering the type alias as an interface. Double check with the actual TS types!

    interface MapComponentSchema {
        clearOnHide?: boolean;
        conditional?: {
            eq?: string | number | boolean;
            show?: boolean;
            when?: string;
        };
        defaultZoom?: null
        | 2
        | 1
        | 3
        | 4
        | 8
        | 5
        | 6
        | 10
        | 7
        | 12
        | 11
        | 9
        | 13;
        description?: string;
        errors?: { required?: string };
        hidden?: boolean;
        id: string;
        initialCenter?: { lat?: number; lng?: number };
        interactions?: { marker: boolean; polygon: boolean; polyline: boolean };
        isSensitiveData?: boolean;
        key: string;
        label: string;
        openForms?: {
            translations?: {
                en?: { description?: string; label?: string; tooltip?: string };
                nl?: { description?: string; label?: string; tooltip?: string };
            };
        };
        overlays?: Overlay[];
        registration?: { attribute: string };
        showInEmail?: boolean;
        showInPDF?: boolean;
        showInSummary?: boolean;
        tileLayerIdentifier?: string;
        tileLayerUrl?: string;
        tooltip?: string;
        translatedErrors?: {
            en?: { required?: string };
            nl?: { required?: string };
        };
        type: "map";
        useConfigDefaultMapSettings?: boolean;
        validate?: { plugins?: string[]; required?: boolean };
    }
    Index

    Properties

    clearOnHide?: boolean

    Clear the value (remove the key from the submission data) when the field is hidden. This is applied if the component itself or any parent is hidden, irrespective the mechanism that made it hidden.

    Related: hidden, conditional.

    conditional?: { eq?: string | number | boolean; show?: boolean; when?: string }

    Type declaration

    • Optionaleq?: string | number | boolean

      The value that should be checked against the reference component value.

      For array values (of the reference component), the array is checked if it contains the specified value.

      Only (a subset of) primitives are supported.

    • Optionalshow?: boolean

      Whether the field should be shown (true) or hidden (false) when the condition is met.

    • Optionalwhen?: string

      The reference component key. Its value will be retrieved and tested against eq.

    defaultZoom?: null | 2 | 1 | 3 | 4 | 8 | 5 | 6 | 10 | 7 | 12 | 11 | 9 | 13

    Default zoom level, limited by Leaflet and the available tile service zoom levels.

    Leaflet zoom level is a range of 1-20, but the Dutch tile service only supports up to level 13.

    description?: string

    Additional information for the form field, displayed unconditionally.

    errors?: { required?: string }

    Resolved custom error messages, for the active locale. Set by the backend from translatedErrors - should never be written to.

    hidden?: boolean

    Hide or show the form field. This only controls the visibility - whether submission data is retained or not is controlled through clearOnHide.

    id: string

    Unique ID for a component in a form definition. Used to render HTML IDs.

    The new renderer does not need this.

    initialCenter?: { lat?: number; lng?: number }

    Coordinates to center the map on initially.

    interactions?: { marker: boolean; polygon: boolean; polyline: boolean }

    Shapes available for users to draw on the map, which set the value of the field/component.

    These interaction options are based on the options available in leaflet draw: https://leaflet.github.io/Leaflet.draw/docs/leaflet-draw-latest.html#drawoptions

    If no interactions are specified at all, this is equivalent to interactions that only allow the marker.

    Type declaration

    • marker: boolean

      Allow putting a marker on the map, setting a single point (PointGeometry).

    • polygon: boolean

      Allow drawing a closed line string, creating a polygon (PolygonGeometry).

    • polyline: boolean

      Allow drawing a line on the map, setting a list of points (LineStringGeometry).

    isSensitiveData?: boolean

    Marker for a form field that requests potentially (privacy) sensitive information.

    Pruning of submission data will clear the data of components marked as sensitive data.

    This is specific to Open Forms.

    key: string

    Unique key for the component in a larger form definition.

    The value must comply with the (\w|\w[\w.\-]*\w) regex, meaning that periods/dots are allowed unless they're start or end. The period character creates a nesting level in the submission data.

    'myField'
    
    'parent.child' // creates `{parent: {child: <value}}` data.
    
    label: string

    The form field label text.

    openForms?: {
        translations?: {
            en?: { description?: string; label?: string; tooltip?: string };
            nl?: { description?: string; label?: string; tooltip?: string };
        };
    }
    overlays?: Overlay[]

    Overlays contain additional (visual) information and may be toggled on/off by the end-user. They are displayed above the background tile layer, and layered in the order of the definition. They can be used to show heat-maps, highlight certain points of interest, or provide additional context. WMS and WFS tile layers provide access to lower-level layers, to specify which parts of the entire data-collection should be shown in the map.

    registration?: { attribute: string }

    Configuration on how to process the value of the component in the registration plugin(s).

    Component-level registration configuration does not work reliably when multiple registration plugins are enabled on the form. This will be moved in the new admin UI.

    showInEmail?: boolean

    Include the component and its value in the confirmation email data.

    showInPDF?: boolean

    Include the component and its value in the submission report PDF available for download by the end-user and often included in registration plugins.

    showInSummary?: boolean

    Include the component and its value in the submission data summary on the confirmation page or not.

    tileLayerIdentifier?: string

    The identifier used for the background tile layer.

    tileLayerUrl?: string

    The url belonging to the connected tile layer object, determined by tileLayerIdentifier.

    This value should not be definable by admins, but should be fetched from the related tile layer object. This happens when fetching the component from the backend.

    tooltip?: string

    Extra information or background for the form field. Displayed after interacting with the tooltip icon/control near the label.

    translatedErrors?: { en?: { required?: string }; nl?: { required?: string } }

    Custom, user-supplied validation error messages for each error message type supported by the validators used in the validation configuration.

    Specified for each supported language - the backend reads this configuration and writes it to errors.

    type: "map"

    Discriminator to determine the component type. Uniquely determines the shape of the component configuration options.

    useConfigDefaultMapSettings?: boolean

    If true, the backend must apply the globally configured defaults to a particular map instance. This results in populating defaultZoom and initialCenter and is therefore only relevant for the backend.

    validate?: { plugins?: string[]; required?: boolean }

    The validation configuration of the component.

    Type declaration

    • Optionalplugins?: string[]

      List of plugin identifiers for async backend validation. The value is considered valid as soon as one plugin considers the value valid.

      This is an Open Forms-specific feature.

    • Optionalrequired?: boolean

      Set to true to require a non-empty value to be provided for the field.