Open Pioneer Trails Packages
    Preparing search index...

    Base interface for feature template configuration.

    Defines the common properties shared by all feature templates, including geometry type, layer association, and drawing options. Feature templates are used to create new features with predefined configurations.

    This interface is combined with FormTemplate to create a complete FeatureTemplate.

    interface BaseFeatureTemplate {
        defaultProperties?: Record<string, unknown>;
        drawingOptions?: DrawingOptions;
        geometryType: "Point" | "LineString" | "Polygon" | "Circle";
        icon?: ReactNode;
        layerId?: string;
        name: string;
    }
    Index

    Properties

    defaultProperties?: Record<string, unknown>

    Default property values for features created with this template.

    These properties are applied to new features before the user edits them. Useful for setting default attribute values or metadata.

    drawingOptions?: DrawingOptions

    Additional options to configure the drawing interaction.

    See DrawingOptions for available configuration options. These are passed to the OpenLayers Draw interaction when creating features.

    geometryType: "Point" | "LineString" | "Polygon" | "Circle"

    The geometry type for features created with this template.

    Determines the type of geometry that can be drawn: "Point", "LineString", "Polygon" or "Circle".

    Note: Geometry type "Circle" in combination with a geometryFunction can also be used to create rectangle geometries (see README.md for details).

    icon?: ReactNode

    Optional icon to display alongside the template name in the UI.

    Can be a React node (e.g., an icon component) or null to hide the icon. If undefined, a default icon is used.

    layerId?: string

    The ID of the layer associated with this feature template.

    Primarily used to determine which form template to display when editing features from a specific layer. By default, when a feature is selected for editing, the first template with a layerId matching the feature's layer ID is chosen to configure the property form. This behavior can be customized by providing a custom implementation of resolveFormTemplate .

    name: string

    The display name of the feature template.

    Shown in the UI when selecting a template. After selection, used as the header text displayed above the form fields in the editor component.