geoview-core - v2.2.0
    Preparing search index...

    Class GeoviewRendererAbstract

    Index

    Constructors

    Properties

    Methods

    Constructors

    Properties

    ALLOWED_ARCADE_KEYWORDS: string[] = ...

    Arcade keywords and functions allowed in expression evaluation

    DEFAULT_FILTER_1EQUALS0: string = '(1=0)'

    The default filter expression when no features should be included

    DEFAULT_FILTER_1EQUALS1: string = '(1=1)'

    The default filter expression when all features should be included

    FillPatternSettings: FillPatternSettings = ...

    Table used to define line symbology to use when drawing polygon fill

    LEGEND_CANVAS_HEIGHT: 50

    Default value of the legend canvas height when the settings do not provide one.

    LEGEND_CANVAS_WIDTH: 50

    Default value of the legend canvas width when the settings do not provide one.

    lineDashSettings: Record<TypeLineStyle, number[] | undefined> = ...

    Table used to define line symbology to use when drawing lineString and polygon perimeters

    processStyle: Record<
        TypeLayerStyleConfigType,
        Record<TypeStyleGeometry, TypeStyleProcessor>,
    > = ...

    Table of function to process the style settings based on the feature geometry and the kind of style settings.

    Methods

    • Decodes a base64-encoded SVG string and replaces parameterized placeholders.

      Placeholders like param(fill) or param(outline) are replaced with actual values provided as query parameters appended to the base64 string. This is particularly useful for decoding and normalizing SVG symbols exported from QGIS, which may include dynamic styling parameters such as fill, stroke, or outline values. The method also applies various cleanup steps to improve SVG compatibility:

      • Fixes QGIS-specific attribute spacing (e.g. "stroke=" issues)
      • Corrects malformed opacity or width attributes
      • Removes extraneous <title>, <desc>, <defs> tags
      • Removes XML headers that can cause encoding errors

      Parameters

      • base64: string

        The base64-encoded SVG string, optionally including query parameters (e.g. "base64:...?...fill=%23ff0000&outline=%23000000")

      Returns string

      The decoded, cleaned, and parameter-substituted SVG XML string

    • Classify the remaining nodes to complete the classification.

      The plus and minus can be a unary or a binary operator. It is only at the end that we can determine their node type. Nodes that start with a number are numbers, otherwise they are variables. If a problem is detected, an error object is thrown with an explanatory message.

      Parameters

      Returns FilterNodeType[]

      The new keywords array with all nodes classified

    • Create a default style to use with a vector feature that has no style configuration.

      Parameters

      • geometryType:
            | "Point"
            | "MultiPoint"
            | "LineString"
            | "MultiLineString"
            | "Polygon"
            | "MultiPolygon"
            | "GeometryCollection"

        Type of geometry (Point, LineString, Polygon)

      • label: string

        Label for the style

      Returns TypeLayerStyleSettings | undefined

      The Style configuration created, or undefined if unable to create it

    • Creates a canvas with the GeometryCollection settings defined in the style.

      Parameters

      • OptionalgeometryCollectionStyle: Style

        Optional style associated to the GeometryCollection

      Returns HTMLCanvasElement

      The created canvas

    • Creates a canvas with the image of an icon that is defined in the point style.

      Parameters

      • OptionalpointStyle: Style

        Optional style associated to the point symbol

      Returns Promise<HTMLCanvasElement | null>

      A promise that resolves with the created canvas, or null if creation fails

    • Creates a canvas with the lineString settings that are defined in the style.

      Parameters

      • OptionallineStringStyle: Style

        Optional style associated to the lineString

      Returns HTMLCanvasElement

      The created canvas

    • Creates a canvas with the vector point settings that are defined in the point style.

      Parameters

      • OptionalpointStyle: Style

        Optional style associated to the point symbol

      Returns HTMLCanvasElement

      The created canvas

    • Create the stroke options using the specified settings.

      Parameters

      • settings:
            | TypeLineStringVectorConfig
            | TypePolygonVectorConfig
            | TypeSimpleSymbolVectorConfig

        Settings to use for the stroke options creation

      Returns Options

      The stroke options created

    • Evaluate an Arcade expression using feature data.

      Supports field references, conditional logic (if/else, ternary), comparison operators, logical operators, and basic string functions (upper, lower).

      Parameters

      • expression: string

        Arcade expression string (e.g., "if($feature.STATUS == 'Active') return 'A' else return 'B'")

      • feature: Feature

        Feature containing field data

      Returns string | number | boolean | null

      The evaluated result (string, number, or boolean) or null if evaluation fails

    • Evaluate a simple value expression using feature data.

      Supports basic arithmetic operations and field references.

      Parameters

      • expression: string

        Expression string (e.g., "$feature["FIELD_NAME"] + 90")

      • feature: Feature

        Feature containing field data

      Returns number | null

      The evaluated result or null if evaluation fails

    • Evaluates whether a feature satisfies a parsed filter equation.

      The filter equation is expected to be in infix order and is evaluated using a stack-based (shunting-yard–style) algorithm that respects operator precedence and grouping.

      Parameters

      • feature: Feature

        The feature whose attributes are used to resolve variable nodes

      • OptionalfilterEquation: FilterNodeType[]

        Optional parsed filter expression tokens

      Returns boolean

      True if the feature satisfies the filter, false otherwise

      When the filter expression is invalid or cannot be evaluated

    • Gets the style of the feature using the layer entry config.

      If the style does not exist for the geometryType, create it using the default style strategy.

      Parameters

      • feature: FeatureLike

        Feature that need its style to be defined

      • layerStyle: TypeLayerStyleConfig

        The style to use

      • label: string

        The style label when one has to be created

      • OptionalfilterEquation: FilterNodeType[]

        Optional filter equation associated to the layer

      • OptionalcallbackWhenCreatingStyle: (
            geometryType:
                | "Point"
                | "MultiPoint"
                | "LineString"
                | "MultiLineString"
                | "Polygon"
                | "MultiPolygon"
                | "GeometryCollection",
            style: TypeLayerStyleConfigInfo,
        ) => void

        Optional callback to execute when a new style had to be created

      Returns Style | undefined

      The style applied to the feature, or undefined if not found

    • Get the default color using the default color index.

      Parameters

      • alpha: number

        Alpha value to associate to the color

      • increment: boolean = false

        Optional true, if we want to skip to next color

      Returns string

      The current default color string

    • Gets the image source from the style of the feature using the layer entry config.

      Parameters

      • style: Style | undefined

        The style to use

      • geometryType:
            | "Point"
            | "MultiPoint"
            | "LineString"
            | "MultiLineString"
            | "Polygon"
            | "MultiPolygon"
            | "GeometryCollection"

        The type of geometry

      • styleSettings: TypeLayerStyleSettings | undefined

        The layer style settings

      Returns string | undefined

      The icon source associated to the feature, or undefined

    • Builds a filter string (SQL-like or OGC-compliant) for a given layer and style configuration.

      This method supports:

      • simple styles: returns the base layer filter or a default (1=1) condition.
      • unique value styles: builds an optimized filter for visible categories.
      • class breaks styles: builds numeric range filters based on visibility flags.

      Parameters

      • outFields: TypeOutfields[] | undefined

        The outfields information

      • style:
            | Partial<
                Record<
                    | "Point"
                    | "MultiPoint"
                    | "LineString"
                    | "MultiLineString"
                    | "Polygon"
                    | "MultiPolygon"
                    | "GeometryCollection",
                    TypeLayerStyleSettings,
                >,
            >
            | undefined

        The style configuration (optional)

      • styleSettings: TypeLayerStyleSettings | undefined

        The layer style settings

      Returns string | undefined

      The filter expression, or undefined if not applicable

    • Gets the legend styles used by the layer as specified by the style configuration.

      Parameters

      • styleConfig:
            | Partial<
                Record<
                    | "Point"
                    | "MultiPoint"
                    | "LineString"
                    | "MultiLineString"
                    | "Polygon"
                    | "MultiPolygon"
                    | "GeometryCollection",
                    TypeLayerStyleSettings,
                >,
            >
            | undefined

        The style configuration

      Returns Promise<
          Partial<
              Record<
                  | "Point"
                  | "MultiPoint"
                  | "LineString"
                  | "MultiLineString"
                  | "Polygon"
                  | "MultiPolygon"
                  | "GeometryCollection",
                  TypeStyleRepresentation,
              >,
          >,
      >

      A promise that resolves with the layer styles

    • Interpolate a color between two hex colors.

      Parameters

      • value: number

        The data value to interpolate for

      • value1: number

        The lower data value

      • value2: number

        The upper data value

      • color1: string | number[]

        The hex color at the lower value

      • color2: string | number[]

        The hex color at the upper value

      Returns string

      The interpolated color in rgba format

    • Interpolate a value between two stops linearly.

      Parameters

      • value: number

        The data value to interpolate for

      • value1: number

        The lower data value

      • value2: number

        The upper data value

      • output1: number

        The output at the lower value

      • output2: number

        The output at the upper value

      Returns number

      The interpolated output value

    • Loads the image of an icon that compose the legend.

      Parameters

      • src: string

        Source information (base64 image) of the image to load

      Returns Promise<HTMLImageElement | null>

      A promise that resolves with the loaded image, or null if loading fails

    • Processes the array of point styles as described in the pointStyleConfig.

      Parameters

      • layerStyles: TypeVectorLayerStyles

        Object that will receive the created canvas

      • arrayOfPointStyleConfig: TypeLayerStyleConfigInfo[]

        Array of point style configuration

      Returns Promise<
          Partial<
              Record<
                  | "Point"
                  | "MultiPoint"
                  | "LineString"
                  | "MultiLineString"
                  | "Polygon"
                  | "MultiPolygon"
                  | "GeometryCollection",
                  TypeStyleRepresentation,
              >,
          >,
      >

      A promise that resolves with the vector layer style

    • Process a backward diagonal fill using the settings.

      Parameters

      • settings: TypePolygonVectorConfig

        Settings to use for the Style creation

      • Optionalgeometry: Geometry

        Optional geometry to associate with the style

      Returns Style | undefined

      The Style created, or undefined if unable to create it

    • Process a circle symbol using the settings.

      Parameters

      • settings: TypeSimpleSymbolVectorConfig

        Settings to use for the Style creation

      Returns Style | undefined

      The Style created, or undefined if unable to create it

    • Process the class break settings using a lineString feature to get its Style.

      Parameters

      • styleSettings: TypeLayerStyleSettings | TypeKindOfVectorSettings

        Style settings to use

      • Optionalfeature: Feature<Geometry>

        Optional feature used to test the unique value conditions

      • Optionaloptions: TypeStyleProcessorOptions

        Optional processing options

      Returns Style | undefined

      The Style created, or undefined if unable to create it

    • Process the class break settings using a Point feature to get its Style.

      Parameters

      • styleSettings: TypeLayerStyleSettings | TypeKindOfVectorSettings

        Style settings to use

      • Optionalfeature: Feature<Geometry>

        Optional feature used to test the unique value conditions

      • Optionaloptions: TypeStyleProcessorOptions

        Optional processing options

      Returns Style | undefined

      The Style created, or undefined if unable to create it

    • Process the class break settings using a Polygon feature to get its Style.

      Parameters

      • styleSettings: TypeLayerStyleSettings | TypeKindOfVectorSettings

        Style settings to use

      • Optionalfeature: Feature<Geometry>

        Optional feature used to test the unique value conditions

      • Optionaloptions: TypeStyleProcessorOptions

        Optional processing options

      Returns Style | undefined

      The Style created, or undefined if unable to create it

    • Process a cross fill using the settings.

      Parameters

      • settings: TypePolygonVectorConfig

        Settings to use for the Style creation

      • Optionalgeometry: Geometry

        Optional geometry to associate with the style

      Returns Style | undefined

      The Style created, or undefined if unable to create it

    • Process a diagonal cross fill using the settings.

      Parameters

      • settings: TypePolygonVectorConfig

        Settings to use for the Style creation

      • Optionalgeometry: Geometry

        Optional geometry to associate with the style

      Returns Style | undefined

      The Style created, or undefined if unable to create it

    • Process a Diamond symbol using the settings.

      Parameters

      • settings: TypeSimpleSymbolVectorConfig

        Settings to use for the Style creation

      Returns Style | undefined

      The Style created, or undefined if unable to create it

    • Process a dot fill using the settings.

      Parameters

      • settings: TypePolygonVectorConfig

        Settings to use for the Style creation

      • Optionalgeometry: Geometry

        Optional geometry to associate with the style

      Returns Style | undefined

      The Style created, or undefined if unable to create it

    • Process a forward diagonal fill using the settings.

      Parameters

      • settings: TypePolygonVectorConfig

        Settings to use for the Style creation

      • Optionalgeometry: Geometry

        Optional geometry to associate with the style

      Returns Style | undefined

      The Style created, or undefined if unable to create it

    • Process a horizontal fill using the settings.

      Parameters

      • settings: TypePolygonVectorConfig

        Settings to use for the Style creation

      • Optionalgeometry: Geometry

        Optional geometry to associate with the style

      Returns Style | undefined

      The Style created, or undefined if unable to create it

    • Process an icon symbol using the settings.

      Parameters

      • settings: TypeIconSymbolVectorConfig

        Settings to use for the Style creation

      Returns Style | undefined

      The Style created, or undefined if unable to create it

    • Process a null fill (polygon with fill opacity = 0) using the settings.

      Parameters

      • settings: TypePolygonVectorConfig

        Settings to use for the Style creation

      • Optionalgeometry: Geometry

        Optional geometry to associate with the style

      Returns Style | undefined

      The Style created, or undefined if unable to create it

    • Process a pattern fill using the settings.

      Parameters

      • settings: TypePolygonVectorConfig

        Settings to use for the Style creation

      • FillPatternLines: FillPatternLine[]

        Fill pattern lines needed to create the fill

      • Optionalgeometry: Geometry

        Optional geometry to associate with the style

      Returns Style | undefined

      The Style created, or undefined if unable to create it

    • Process a + symbol using the settings.

      Parameters

      • settings: TypeSimpleSymbolVectorConfig

        Settings to use for the Style creation

      Returns Style | undefined

      The Style created, or undefined if unable to create it

    • Process a regular shape using the settings, the number of points, the angle and the scale.

      Parameters

      • settings: TypeSimpleSymbolVectorConfig

        Settings to use for the Style creation

      • points: number

        Number of points needed to create the symbol

      • angle: number

        Angle to use for the symbol creation

      • scale: [number, number]

        Scale to use for the symbol creation

      Returns Style | undefined

      The Style created, or undefined if unable to create it

    • Process a simple lineString using the settings.

      Parameters

      • styleSettings: TypeLayerStyleSettings | TypeKindOfVectorSettings

        Settings to use for the Style creation

      • Optionalfeature: Feature<Geometry>

        Optional feature. This method does not use it, it is there to have a homogeneous signature

      • Optionaloptions: TypeStyleProcessorOptions

        Optional processing options

      Returns Style | undefined

      The Style created, or undefined if unable to create it

    • Process a simple point symbol using the settings.

      Simple point symbol may be an icon or a vector symbol.

      Parameters

      • styleSettings: TypeLayerStyleSettings | TypeKindOfVectorSettings

        Settings to use for the Style creation

      • Optionalfeature: Feature<Geometry>

        Optional feature. This method does not use it, it is there to have a homogeneous signature

      • Optionaloptions: TypeStyleProcessorOptions

        Optional processing options

      Returns Style | undefined

      The Style created, or undefined if unable to create it

    • Process a simple polygon using the settings.

      Parameters

      • styleSettings: TypeLayerStyleSettings | TypeKindOfVectorSettings

        Settings to use for the Style creation

      • Optionalfeature: Feature<Geometry>

        Optional feature. This method does not use it, it is there to have a homogeneous signature

      • Optionaloptions: TypeStyleProcessorOptions

        Optional processing options

      Returns Style | undefined

      The Style created, or undefined if unable to create it

    • Process a simple solid fill (polygon) using the settings.

      Parameters

      • settings: TypePolygonVectorConfig

        Settings to use for the Style creation

      • Optionalgeometry: Geometry

        Optional geometry to associate with the style

      Returns Style | undefined

      The Style created, or undefined if unable to create it

    • Process a square symbol using the settings.

      Parameters

      • settings: TypeSimpleSymbolVectorConfig

        Settings to use for the Style creation

      Returns Style | undefined

      The Style created, or undefined if unable to create it

    • Process a star shape symbol using the settings.

      Parameters

      • settings: TypeSimpleSymbolVectorConfig

        Settings to use for the Style creation

      • points: number

        Number of points needed to create the symbol

      • angle: number

        Angle to use for the symbol creation

      Returns Style | undefined

      The Style created, or undefined if unable to create it

    • Process a star symbol using the settings.

      Parameters

      • settings: TypeSimpleSymbolVectorConfig

        Settings to use for the Style creation

      Returns Style | undefined

      The Style created, or undefined if unable to create it

    • Process a triangle symbol using the settings.

      Parameters

      • settings: TypeSimpleSymbolVectorConfig

        Settings to use for the Style creation

      Returns Style | undefined

      The Style created, or undefined if unable to create it

    • Process the unique value settings using a lineString feature to get its Style.

      Parameters

      • styleSettings: TypeLayerStyleSettings | TypeKindOfVectorSettings

        Style settings to use

      • Optionalfeature: Feature<Geometry>

        Optional feature used to test the unique value conditions

      • Optionaloptions: TypeStyleProcessorOptions

        Optional processing options

      Returns Style | undefined

      The Style created, or undefined if unable to create it

    • Process the unique value settings using a polygon feature to get its Style.

      Parameters

      • styleSettings: TypeLayerStyleSettings | TypeKindOfVectorSettings

        Style settings to use

      • Optionalfeature: Feature<Geometry>

        Optional feature used to test the unique value conditions

      • Optionaloptions: TypeStyleProcessorOptions

        Optional processing options

      Returns Style | undefined

      The Style created, or undefined if unable to create it

    • Process the unique value settings using a point feature to get its Style.

      Parameters

      • styleSettings: TypeLayerStyleSettings | TypeKindOfVectorSettings

        Style settings to use

      • Optionalfeature: Feature<Geometry>

        Optional feature used to test the unique value conditions

      • Optionaloptions: TypeStyleProcessorOptions

        Optional processing options

      Returns Style | undefined

      The Style created, or undefined if unable to create it

    • Process a vertical fill using the settings.

      Parameters

      • settings: TypePolygonVectorConfig

        Settings to use for the Style creation

      • Optionalgeometry: Geometry

        Optional geometry to associate with the style

      Returns Style | undefined

      The Style created, or undefined if unable to create it

    • Process a X symbol using the settings.

      Parameters

      • settings: TypeSimpleSymbolVectorConfig

        Settings to use for the Style creation

      Returns Style | undefined

      The Style created, or undefined if unable to create it

    • Returns the type of geometry.

      It removes the Multi prefix because for the geoviewRenderer, a MultiPoint has the same behaviour than a Point.

      Parameters

      • geometryType:
            | "Point"
            | "MultiPoint"
            | "LineString"
            | "MultiLineString"
            | "Polygon"
            | "MultiPolygon"
            | "GeometryCollection"

        The geometry type to check

      Returns
          | "Point"
          | "MultiPoint"
          | "LineString"
          | "MultiLineString"
          | "Polygon"
          | "MultiPolygon"
          | "GeometryCollection"

      The type of geometry (Point, LineString, Polygon)

    • Returns the type of geometry.

      It removes the Multi prefix because for the geoviewRenderer, a MultiPoint has the same behaviour than a Point.

      Parameters

      • feature: FeatureLike

        The feature to check

      • defaultLayerStyle: TypeLayerStyleConfig

        The default layer style config to use when the feature has no geometry

      Returns
          | "Point"
          | "MultiPoint"
          | "LineString"
          | "MultiLineString"
          | "Polygon"
          | "MultiPolygon"
          | "GeometryCollection"

      The type of geometry (Point, LineString, Polygon)

    • Search the class break entry using the field value stored in the feature.

      Parameters

      • field: string | undefined

        Optional field involved in the class break definition

      • classBreakStyleInfo: TypeLayerStyleConfigInfo[]

        Class break configuration

      • feature: Feature

        Feature used to test the class break conditions

      • OptionalaliasLookup: TypeAliasLookup

        Optional lookup table to handle field name aliases

      • OptionalvalueExpression: string

        Optional Arcade expression to evaluate instead of using field

      Returns TypeLayerStyleConfigInfo | undefined

      The matching entry, or undefined if unable to find it

    • Check whether a numeric value falls within a class-break interval using provided boundary conditions.

      The conditions parameter is expected to be a two-element array where:

      • conditions[0] is the lower-bound operator: 'gt' (>) or 'gte' (>=)
      • conditions[1] is the upper-bound operator: 'lt' (<) or 'lte' (<=) Examples:
      • ['gte','lte'] => min <= value <= max
      • ['gt','lte'] => min < value <= max

      Parameters

      • value: number

        The numeric value to test

      • min: number

        The lower bound of the interval

      • max: number

        The upper bound of the interval

      • conditions: TypeLayerStyleValueCondition[]

        Two-element array describing the boundary operators

      Returns boolean

      True if the value satisfies the interval according to the conditions, false otherwise

      When conditions contains an unsupported combination of operators

    • Search the unique value entry using the field values stored in the feature.

      Parameters

      • fields: string[]

        Fields involved in the unique value definition

      • uniqueValueStyleInfo: TypeLayerStyleConfigInfo[]

        Unique value configuration

      • Optionalfeature: Feature<Geometry>

        Optional feature used to test the unique value conditions

      • OptionaldomainsLookup: TypeLayerMetadataFields[]

        Optional lookup table to handle coded value domains

      • OptionalaliasLookup: TypeAliasLookup

        Optional lookup table to handle field name aliases

      • OptionalvalueExpression: string

        Optional Arcade expression to evaluate instead of using fields

      Returns TypeLayerStyleConfigInfo | undefined

      The Style created, or undefined if unable to create it

    • Encodes an SVG XML string into a base64-encoded string.

      This is the inverse of base64ToSVGString, allowing you to safely embed or transmit SVG data in formats where raw XML is not permitted.

      Parameters

      • svgXML: string

        The raw SVG XML string to encode

      Returns string

      A base64-encoded representation of the SVG string