POLAR reference
    Preparing search index...

    Plugin options for gfi plugin.

    An example configuration for the plugin might look like this:

    {
    mode: 'bboxDot',
    afterLoadFunction,
    layers: {
    'layerId': {
    geometry: true,
    window: true,
    maxFeatures: 10,
    geometryName: 'app:geometry',
    exportProperty: 'Export',
    },
    },
    coordinateSources: [
    { plugin: 'pins', key: 'transformedCoordinate' },
    { plugin: 'pins', key: 'coordinatesAfterDrag' },
    ],
    customHighlightStyle: {
    stroke: {
    color: '#FFFF00',
    width: 3,
    },
    fill: {
    color: 'rgb(255, 255, 255, 0.7)',
    },
    },
    }

    function afterLoadFunction(featuresByLayerId: Record<string, GeoJsonFeature[]>): Record<string, GeoJsonFeature[]> {
    const filteredFeaturesByLayerId: Record<string, GeoJsonFeature[]> = {};
    for (const layerId in featuresByLayerId) {
    if (featuresByLayerId.hasOwnProperty(layerId)) {
    const features = featuresByLayerId[layerId];
    filteredFeaturesByLayerId[layerId] = features.filter(feature => feature.properties.type === 'desiredType');
    }
    }
    return filteredFeaturesByLayerId;
    }
    interface GfiPluginOptions {
        layers: Record<string, GfiLayerConfiguration>;
        afterLoadFunction?: (
            featuresByLayerId: Record<string, GeoJsonFeature[]>,
        ) => Record<string, GeoJsonFeature[]>;
        coordinateSources?: StoreReference[];
        customHighlightStyle?: CustomHighlightStyle;
        directSelect?: boolean;
        displayComponent?: boolean;
        featureList?: FeatureList;
        layoutTag?:
            | "TOP_LEFT"
            | "TOP_MIDDLE"
            | "TOP_RIGHT"
            | "MIDDLE_LEFT"
            | "MIDDLE_MIDDLE"
            | "MIDDLE_RIGHT"
            | "BOTTOM_LEFT"
            | "BOTTOM_MIDDLE"
            | "BOTTOM_RIGHT";
        maxFeatures?: number;
        mode?: "bboxDot"
        | "intersects";
        multiSelect?: "circle" | "box";
        renderType?: "iconMenu" | "independent";
    }

    Hierarchy (View Summary)

    Index

    Properties

    layers: Record<string, GfiLayerConfiguration>

    Maps a string (must be a layer ID) to a behaviour configuration for that layer.

    afterLoadFunction?: (
        featuresByLayerId: Record<string, GeoJsonFeature[]>,
    ) => Record<string, GeoJsonFeature[]>

    This method can be used to extend, filter, or otherwise modify a GFI result.

    Type Declaration

      • (
            featuresByLayerId: Record<string, GeoJsonFeature[]>,
        ): Record<string, GeoJsonFeature[]>
      • Parameters

        • featuresByLayerId: Record<string, GeoJsonFeature[]>

          List of features by layer ID

        Returns Record<string, GeoJsonFeature[]>

        Extended, filtered, or otherwise modified result

    coordinateSources?: StoreReference[]

    The plugin will react to these coordinate positions in the store. This allows it to react to e.g. the address search or the pins plugin. Please see the example configuration for the common use-cases. Please mind that, when referencing another plugin, that plugin must be in addPlugins before this one.

    customHighlightStyle?: CustomHighlightStyle

    If required, a user can change the stroke and fill of the highlighted feature. The default style as seen in the example will be used for each part that is not customized. An empty object will return the complete default style while e.g. for an object without a configured fill the default fill will be applied.

    directSelect?: boolean

    If true, a feature can be selected without defining a value in gfi.coordinateSources.

    It is also possible to add multiple features to the selection by using the modifier key (CTRL on Windows or Command on macOS). To delesect a feature, simply reclick it with the modifier key pressed. To create a new selection, click anywhere else without pressing the modifier key.

    Be careful when using this parameter together with some values set in coordinateSources as it may lead to unexpected results. The features need to be distinguishable by their properties for the functionality to properly work.

    Does not work together with extendedMasterportalapiMarkers.

    false
    
    displayComponent?: boolean

    Should the component be visible at all.

    false

    featureList?: FeatureList

    If defined, a list of available vector layer features is visible when no feature is selected. Only usable if renderType is set to iconMenu and window is set to true for at least one configured layer.

    layoutTag?:
        | "TOP_LEFT"
        | "TOP_MIDDLE"
        | "TOP_RIGHT"
        | "MIDDLE_LEFT"
        | "MIDDLE_MIDDLE"
        | "MIDDLE_RIGHT"
        | "BOTTOM_LEFT"
        | "BOTTOM_MIDDLE"
        | "BOTTOM_RIGHT"

    The region where the plugin should be rendered. Required for nine-regions layout, ignored otherwise.

    maxFeatures?: number

    Limits the viewable GFIs per layer by this number. The first n elements are chosen arbitrarily. Useful if you e.g. just want one result, or to limit an endless stream of returns to e.g. 10. Infinite by default.

    10
    
    mode?: "bboxDot" | "intersects"

    Method of calculating which feature has been chosen by the user. bboxDot utilizes the bbox-url parameter using the clicked coordinate while intersects uses a Filter to calculate the intersected features. Layers can have their own gfiMode parameter which would override this global mode. To apply this, add the desired value to the parameter in the mapConfiguration.

    'bboxDot'

    multiSelect?: "circle" | "box"

    If configured, multiple features can be selected at once by using the modifier key (CTRL on Windows or Command on macOS) and dragging the mouse. Can only be used in Desktop environments.

    If set to 'box', the selection will be done in a box. If set to 'circle', the selection will be done in a circle.

    Similar to directSelect, features can be added and removed by selection / unselecting them. The features need to be distinguishable by their properties for the functionality to properly work. Does not work together with extendedMasterportalapiMarkers of @polar/core.

    Disabled by default
    
    renderType?: "iconMenu" | "independent"

    Defines if the plugin is rendered independent or as part of the icon menu. This is automatically set by the icon menu; you should not need to touch this.

    'independent'