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

    Class GVXYZTiles

    Manages a Tile layer.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    Methods

    emitLayerFilterApplied emitMessage formatFeatureInfoResult getAllFeatureInfo getAttributions getBounds getClassName getExtent getExtentFromFeatures getFeatureInfo getFeatureInfoAtCoordinate getFeatureInfoAtLonLat getFeatureInfoAtPixel getFeatureInfoUsingBBox getFeatureInfoUsingPolygon getFilterFromStyle getGeoviewLayerId getGeoviewLayerName getHitTolerance getHoverable getInVisibleRange getIsTimeAware getLayerConfig getLayerFilters getLayerName getLayerPath getLayerStatus getLegend getMaxZoom getMinZoom getOLLayer getOLSource getOpacity getParent getParentRoot getParents getQueryable getStyle getStyleItemVisibility getTimeDimension getVisible getVisibleIncludingParents init inVisibleRange offLayerError offLayerFilterApplied offLayerFirstLoaded offLayerHoverableChanged offLayerItemVisibilityChanged offLayerLoaded offLayerLoading offLayerMessage offLayerNameChanged offLayerOpacityChanged offLayerQueryableChanged offLayerStyleChanged offLayerVisibleChanged offLayerZIndexChanged offLegendQueried offLegendQuerying onError onErrorDecipherError onFetchLegend onGetAttributions onGetBounds onGetExtentFromFeatures onImageLoadError onImageLoadErrorDecipherError onLayerError onLayerFilterApplied onLayerFirstLoaded onLayerHoverableChanged onLayerItemVisibilityChanged onLayerLoaded onLayerLoading onLayerMessage onLayerNameChanged onLayerOpacityChanged onLayerQueryableChanged onLayerStyleChanged onLayerVisibleChanged onLayerZIndexChanged onLegendQueried onLegendQuerying onLoaded onLoading onRefresh onSetLayerFilters onSetOpacity onSetStyleAccordingToLegend onSetVisible onSetZIndex queryLegend refresh setExtent setHoverable setLayerFilters setLayerFiltersDate setLayerName setLegend setMaxZoom setMinZoom setOLLayer setOpacity setParent setQueryable setStyle setStyleItemVisibility setVisible setZIndex waitForRender waitForSourceReady waitLegendFetched waitLoadedOnce waitLoadedStatus waitStyleApplied createLegendFromStyle getFeatureIconSource getParent helperFormatFeatureInfoResult helperGetFieldValue initOptionsWithInitialSettings

    Constructors

    Properties

    loadedOnce: boolean = false

    Indicates if the layer has become in loaded status at least once already

    loadingCounter: number = 0

    Counts the number of times the loading happened.

    loadingMarker: number = 0

    Marks the latest loading count for the layer. This useful to know when the put the layer loaded status back correctly with parallel processing happening

    DEFAULT_HIT_TOLERANCE: number = 4

    The default hit tolerance the query should be using

    DEFAULT_LOADING_PERIOD: number = ...

    The default loading period before we show a message to the user about a layer taking a long time to render on map

    Methods

    • Emits a layer-specific message event with localization support.

      Parameters

      • messageKey: string

        The key used to lookup the localized message OR message

      • messageParams: unknown[] | undefined

        Array of parameters to be interpolated into the localized message

      • messageType: SnackbarType = 'info'

        The message type

      • notification: boolean = false

        Optional whether to show this as a notification. Defaults to false

      Returns void

      this.emitMessage(
      'layers.fetchProgress',
      ['50', '100'],
      messageType: 'error',
      true
      );
    • Formats a list of features into an array of TypeFeatureInfoEntry, including icons, field values, domains, and metadata.

      Parameters

      • features: Feature<Geometry>[]

        Array of features to format

      • layerConfig:
            | EsriDynamicLayerEntryConfig
            | VectorLayerEntryConfig
            | OgcWmsLayerEntryConfig
            | EsriImageLayerEntryConfig

        Configuration of the associated layer

      • serviceDateFormat: string | undefined

        Optional date format used by the service

      • serviceDateIANA: string | undefined

        Optional IANA time zone identifier used by the service

      • serviceDateTemporalMode: TemporalMode | undefined

        Optional temporal mode for date handling

      Returns TypeFeatureInfoEntry[]

      An array of TypeFeatureInfoEntry objects

    • Overridable function to get all feature information for all the features stored in the layer.

      Parameters

      • map: Map

        The Map so that we can grab the resolution/projection we want to get features on

      • layerFilters: LayerFilters

        The layer filters to apply when querying the features

      • OptionalabortController: AbortController

        Optional AbortController to cancel the operation

      Returns Promise<TypeFeatureInfoResult>

      A promise that resolves with the feature info result

      When the function isn't overridden by the children class

    • Gets the bounds for the layer in the given projection. When the layer is a GVLayer, its layer bounds are returned. When the layer is a GVGroup, an Extent union of all layers bounds in the group is returned.

      Parameters

      • projection: Projection

        The projection to get the bounds into

      • stops: number

        The number of stops to use to generate the extent

      Returns Promise<Extent | undefined>

      A promise that resolves with the layer bounding box or undefined when not found

    • Gets the extent of an array of features.

      Parameters

      • objectIds: string[] | number[]

        The IDs of the features to calculate the extent from.

      • outProjection: Projection

        The output projection for the extent.

      • Optionaloutfield: string

        Optional. ID field to return for services that require a value in outfields.

      Returns Promise<Extent>

      A promise that resolves to the extent of the features, if available.

    • Returns feature information for the layer specified.

      Parameters

      • map: Map

        The Map to get feature info from

      • queryType: QueryType

        The type of query to perform

      • location: TypeLocation

        A pixel, coordinate or polygon that will be used by the query

      • queryGeometry: boolean = true

        Whether to include geometry in the query, default is true

      • abortController: AbortController | undefined = undefined

        Optional AbortController to cancel the operation

      Returns Promise<TypeFeatureInfoResult>

      A promise that resolves with the feature info result

    • Overridable function to return of feature information at a given coordinate.

      Parameters

      • map: Map

        The Map where to get Feature Info At Coordinate from

      • location: Coordinate

        The coordinate that will be used by the query

      • queryGeometry: boolean = true

        Whether to include geometry in the query, default is true

      • abortController: AbortController | undefined = undefined

        Optional AbortController to cancel the operation

      Returns Promise<TypeFeatureInfoResult>

      A promise that resolves with the feature info result

      When the function isn't overridden by the children class

    • Overridable function to return of feature information at the provided long lat coordinate.

      Parameters

      • map: Map

        The Map where to get Feature Info At LonLat from

      • lonlat: Coordinate

        The coordinate that will be used by the query

      • queryGeometry: boolean = true

        Whether to include geometry in the query, default is true

      • abortController: AbortController | undefined = undefined

        Optional AbortController to cancel the operation

      Returns Promise<TypeFeatureInfoResult>

      A promise that resolves with the feature info result

      When the function isn't overridden by the children class

    • Overridable function to return of feature information at a given pixel location.

      Parameters

      • map: Map

        The Map where to get Feature Info At Pixel from

      • location: Pixel

        The pixel coordinate that will be used by the query

      • queryGeometry: boolean = true

        Whether to include geometry in the query, default is true

      • abortController: AbortController | undefined = undefined

        Optional AbortController to cancel the operation

      Returns Promise<TypeFeatureInfoResult>

      A promise that resolves with the feature info result

    • Overridable function to return of feature information at the provided bounding box.

      Parameters

      • map: Map

        The Map where to get Feature using BBox from

      • location: Coordinate[]

        The bounding box that will be used by the query

      • queryGeometry: boolean = true

        Whether to include geometry in the query, default is true

      • abortController: AbortController | undefined = undefined

        Optional AbortController to cancel the operation

      Returns Promise<TypeFeatureInfoResult>

      A promise that resolves with the feature info result

      When the function isn't overridden by the children class

    • Overridable function to return of feature information at the provided polygon.

      Parameters

      • map: Map

        The Map where to get Feature Info using Polygon from

      • location: Coordinate[]

        The polygon that will be used by the query

      • queryGeometry: boolean = true

        Whether to include geometry in the query, default is true

      • abortController: AbortController | undefined = undefined

        Optional AbortController to cancel the operation

      Returns Promise<TypeFeatureInfoResult>

      A promise that resolves with the feature info result

      When the function isn't overridden by the children class

    • Retrieves all parent group layers of this layer in hierarchical order.

      The returned array starts with the immediate parent and continues up the hierarchy until the root group layer is reached or a group has already been visited (not supposed to happen).

      This method traverses upward through the parent chain starting from the immediate parent of this layer. A protection mechanism prevents infinite loops in case of circular parent references.

      Returns GVGroupLayer[]

      An array of parent GVGroupLayer instances, ordered from the immediate parent to the top-most ancestor. Returns an empty array if the layer has no parent.

    • Gets the layer style.

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

      The layer style

    • Determines whether this layer is visible, taking into account the visibility of all its parent groups. A layer is considered visible only if:

      • the layer itself is visible, and
      • every parent GVGroupLayer up the hierarchy is also visible. This function walks upward through the group layer tree until it reaches the root, returning false immediately if any parent is not visible.

      Returns boolean

      true if this layer and all its parent groups are visible; otherwise false.

    • Overrides the way to get the bounds for this layer type.

      Parameters

      • projection: Projection

        The projection to get the bounds into

      • stops: number

        The number of stops to use to generate the extent

      Returns Promise<Extent | undefined>

      A promise that resolves with the layer bounding box or undefined when not found

    • Overridable function that gets the extent of an array of features.

      Parameters

      • objectIds: string[] | number[]

        The IDs of the features to calculate the extent from

      • outProjection: Projection

        The output projection for the extent

      • Optionaloutfield: string

        Optional ID field to return for services that require a value in outfields

      Returns Promise<Extent>

      A promise that resolves with the extent of the features

      When the function isn't overridden by the children class

    • Overridable method to set the opacity of the layer.

      If the layer has a parent, the provided opacity is clamped so that it cannot be greater than the parent's opacity. The resulting opacity is applied to the underlying OpenLayers layer.

      If the layer is a GVGroupLayer, the computed opacity is recursively applied to all child layers to maintain consistency within the layer hierarchy.

      Optionally emits a layer opacity change event.

      Parameters

      • opacity: number

        The desired opacity for the layer, typically between 0 (fully transparent) and 1 (fully opaque).

      • emitOpacityChanged: boolean = true

        Optional, whether to emit a layer opacity changed event after updating the opacity. Defaults to true.

      Returns void

    • Sets the opacity of the layer while ensuring it does not exceed the opacity of its parent layer.

      If the layer has a parent, the provided opacity is clamped so that it cannot be greater than the parent's opacity. The resulting opacity is applied to the underlying OpenLayers layer.

      If the layer is a GVGroupLayer, the computed opacity is recursively applied to all child layers to maintain consistency within the layer hierarchy.

      Optionally emits a layer opacity change event.

      Parameters

      • opacity: number

        The desired opacity for the layer, typically between 0 (fully transparent) and 1 (fully opaque).

      • emitOpacityChanged: boolean = true

        Optional, whether to emit a layer opacity change event after updating the opacity. Defaults to true.

      Returns void

    • Updates the visibility of a style item on the layer and triggers a re-render.

      This method mutates the layer's style configuration for the specified legend item, calls changed() on the underlying OpenLayers layer to schedule a new render, and optionally waits for the next render cycle to complete.

      Parameters

      • item: TypeLegendItem

        The legend/style item whose visibility will be updated

      • visible: boolean

        Whether the style item should be visible

      • waitForRender: boolean

        When true, waits for the next layer render to complete before resolving

      Returns Promise<void>

      A promise that resolves after the visibility has been updated and, if requested, the layer has finished rendering

    • Utility function allowing to wait for the layer style to be applied.

      Parameters

      • timeout: number = 30000

        A timeout for the period to wait for. Defaults to 30,000 ms

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

      A promise that resolves when the layer style has been applied

    • Creates a legend object based on a given GeoView layer type and style configuration.

      This method builds a legend representation by combining the provided style settings with the computed legend symbols retrieved from the renderer. It is asynchronous because it waits for GeoviewRenderer.getLegendStyles to generate the legend items.

      Parameters

      • schemaTag: TypeGeoviewLayerType

        The GeoView layer type identifier (e.g., vector, raster, etc.)

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

        Optional style configuration mapping geometry types to their style settings

      Returns Promise<TypeLegend>

      A promise that resolves with a legend object containing type, styleConfig, and legend entries

    • Retrieves or generates an image source (data URI or path) representing the visual style of a feature.

      Caches results in the imageSourceDict to avoid redundant processing.

      Parameters

      • feature: Feature

        The feature whose visual representation is to be retrieved

      • layerStyle: TypeLayerStyleConfig

        Style configuration grouped by geometry type (e.g., Point, LineString, Polygon)

      • domainsLookup: TypeLayerMetadataFields[] | undefined

        Optional domain information for interpreting coded values

      • aliasLookup: Record<string, string>

        A mapping of original field names to their aliases

      • imageSourceDict: Record<string, string | undefined>

        A dictionary used to cache and reuse image sources by style key

      Returns string | undefined

      The image source string representing the feature's style, or undefined when generation fails

    • Recursively searches the layer tree to find the parent GVGroupLayer of a given layer.

      The search begins from the provided list of layers, which should represent the root-level layer collection. This method walks top-down through all nested GVGroupLayers until it finds the group whose children contain the specified layer. It proceeds this way, because OpenLayers doesn't have a way to start from a leaf - have to start from the root.

      Parameters

      • layer: AbstractBaseGVLayer

        The layer for which the parent group is being searched.

      • groupLayers: AbstractBaseGVLayer[]

        The list of layers to search within. Typically this is the root layer group of the map.

      Returns GVGroupLayer | undefined

      The parent group layer if found, otherwise undefined if the layer has no parent.

    • Formats a set of OpenLayers features into a structured array of feature info entries.

      Each feature is enriched with geometry, extent, field information, and optional styling. Will not throw; errors are caught and logged. Returns an empty array if processing fails.

      Parameters

      • features: Feature<Geometry>[]

        Array of OpenLayers features to process

      • layerPath: string

        Path of the layer these features belong to

      • schemaTag: TypeGeoviewLayerType

        The Geoview layer type for the features

      • nameField: string | undefined

        Optional field name to use as the display name for features

      • outFields: TypeOutfields[] | undefined

        Optional array of output fields to include in the feature info

      • supportZoomTo: boolean

        Whether zoom-to functionality is supported for these features

      • domainsLookup: TypeLayerMetadataFields[] | undefined

        Optional array of field metadata for domain lookups

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

        Optional mapping of geometry type to style settings for icons

      • inputFormat: string | string[] | undefined

        Optional format(s) to prioritize for string inputs

      • inputTimezone: string | undefined

        Optional IANA timezone the dates are in

      • inputTemporalMode: TemporalMode | undefined

        Optional temporal mode for date handling

      • callbackGetFieldValue: GetFieldValueDelegate

        Callback that returns the value of a field for a feature, in the correct type

      Returns TypeFeatureInfoEntry[]

      Array of feature info entries representing each feature with enriched metadata

    • Retrieves and formats the value of a field from an OpenLayers feature.

      • For date fields, the raw value (epoch ms or date string) is normalized via the date management utilities.
      • For fields with a codedValue domain, the raw code is resolved to its human-readable name. If no matching code is found, the raw value is returned.
      • For all other fields, the raw value is returned as-is.

      Parameters

      • feature: Feature

        The OpenLayers feature containing the field values.

      • fieldName: string

        The name of the field to retrieve.

      • fieldType: TypeOutfieldsType

        The data type of the field (e.g. 'string', 'number', 'date', 'oid').

      • fieldDomain: codedValueType | rangeDomainType | undefined

        Optional domain metadata. When present and of type codedValue, the raw field value is mapped to the corresponding coded-value name.

      • inputFormat: string | string[] | undefined

        Optional format(s) to prioritize when parsing date string inputs.

      • inputTimezone: string | undefined

        Optional IANA timezone to assume when interpreting date values.

      • inputTemporalMode: TemporalMode | undefined

        Optional temporal mode. 'calendar' treats dates as timezone-agnostic calendar dates; 'instant' treats them as timezone-aware moments.

      Returns unknown

      The processed field value: a formatted date for date fields, the decoded name for coded-value domains, or the raw value otherwise.