import { Color as Color_2 } from '@here/xyz-maps-common'; import * as common from '@here/xyz-maps-common'; import { CoordinatesUpdateHook } from '@here/xyz-maps-editor'; import { ExpressionParser } from '@here/xyz-maps-common'; import { FeatureRemoveHook } from '@here/xyz-maps-editor'; import { Listener } from '@here/xyz-maps-common'; import { NavlinkDisconnectHook } from '@here/xyz-maps-editor'; import { NavlinkSplitHook } from '@here/xyz-maps-editor'; import RBush from 'rbush/rbush.min.js'; import { TerrainTileProvider as TerrainTileProvider_2 } from '@here/xyz-maps-core'; /** * The `AmbientLight` interface represents ambient lighting, which provides a constant level of illumination across all objects. * * @extends Light */ export declare interface AmbientLight extends Light { /** * The type of light. For `AmbientLight`, this is always 'ambient'. */ type: 'ambient'; } /** * Interface for configuring the visual appearance of Boxes. */ export declare interface BoxStyle { /** * Specifies the type of style to render. */ type: 'Box'; /** * Indicates the drawing order within a layer. * Styles with larger zIndex value are rendered above those with smaller values. * The zIndex is defined relative to the "zLayer" property. * If "zLayer" is defined all zIndex values are relative to the "zLayer" value. */ zIndex: number | StyleValueFunction | StyleZoomRange | StyleExpression; /** * Indicates drawing order across multiple layers. * Styles using zLayer with a high value are rendered on top of zLayers with a low value. * If no zLayer is defined, it will fall back to the {@link LayerStyle.zLayer} or depend on the display layer order. * The first (lowest) layer has a zLayer value of 1. * * @example \{...zLayer: 2, zIndex: 5\} will be rendered on top of \{...zLayer: 1, zIndex: 10\} */ zLayer?: number | StyleValueFunction | StyleExpression; /** * Sets the color to fill the Box. * * @see {@link Color} for a detailed list of possible supported formats. */ fill?: Color | StyleValueFunction | StyleZoomRange | StyleExpression; /** * Sets the stroke color of the Box. * * @see {@link Color} for a detailed list of possible supported formats. */ stroke?: Color | StyleValueFunction | StyleZoomRange | StyleExpression; /** * Sets the width of the stroke. * The unit of strokeWidth is defined in pixels. * * @example * ```typescript * // define a red filled Box that with a blue stroke of 2px width. * { * zIndex: 0, * type: "Box", * fill: "red", * stroke: "blue", * strokeWidth: "2 * } * ``` */ strokeWidth?: number | string | StyleValueFunction | StyleZoomRange | StyleExpression; /** * Defines the opacity of the style. * The value must be between 0.0 (fully transparent) and 1.0 (fully opaque). * * @defaultValue 1 */ opacity?: number | StyleValueFunction | StyleZoomRange | StyleExpression; /** * The Width of the Box. * The unit of width is defined in pixels. * * @example * ```typescript * // define a Box that has a width, height and depth of 32 pixels. * { * zIndex: 0, * type: "Box", * fill: "blue", * width: 32 * } * ``` */ width: number | StyleValueFunction | StyleZoomRange | StyleExpression; /** * The Height of the Box. * The unit of height is defined in pixels. * If the height is not explicitly defined, the value of the width is used as the height. * * @example * ```typescript * // define a Box that have a width of 32px and a height of 48px. * { * zIndex: 0, * type: "Box", * fill: "blue", * width: 32, * height: 48 * } * ``` */ height?: number | StyleValueFunction | StyleZoomRange | StyleExpression; /** * The depth of the Box. * The depth defines the length of the edges of a "Box" parallel to the Z axis. * If the depth is not explicitly defined, the value of the "width" is used as the height. * * @example * ```typescript * // define a Box that has a width, height and depth of 16px * { * zIndex: 0, * type: "Box", * stroke: "blue", * fill: "red", * width: 16, * height: 16, * depth: 16 * } * ``` */ depth?: number | StyleValueFunction | StyleZoomRange | StyleExpression; /** * Offset the Box in pixels on x-axis. * A positive value offsets to the right, a negative value to the left. * The default unit is pixels. * * @example * ```typescript * // offset Box by 8px to the right. * { type: "Box", zIndex: 0, with: 32, fill: 'red', offsetX: 8} * ``` */ offsetX?: number | string | StyleValueFunction | StyleZoomRange | StyleExpression; /** * Offset the Box in pixels on y-axis. * A positive value offsetY offsets downwards, a negative value upwards. * The default unit is pixels. * * @example * ```typescript * // offset Box by 8px to the bottom * { type: "Box", zIndex: 0, fill: 'red', width:32, offsetY: 8} * * // offset Box by 1m to the top * { type: "Box", zIndex: 0, fill: 'blue', width: 32, offsetY: "-1m"} * ``` */ offsetY?: number | StyleValueFunction | StyleZoomRange | StyleExpression; /** * Offset the Box in pixels on z-axis. * A positive value offsets up, a negative value down. * The default unit is pixels. * * @example * ```typescript * // offset Image by 8px to the top. * { type: "Box", zIndex: 0, fill: 'red', width:32, offsetZ: 8} * * // offset Circle by 1m to the top * { type: "Box", zIndex: 0, fill: 'red', width:32, offsetZ: "1m"} * ``` */ offsetZ?: number | string | StyleValueFunction | StyleZoomRange | StyleExpression; /** * Altitude of the Box center in meters. * * Describes the vertical distance from the global ground plane (0m) to the Box. * * Supported values: * - false (default): place at 0m. * - true: use the altitude (z) from the feature geometry if present, else 0. Not re-aligned to the rendered terrain. * If the geometry altitude source differs from the TerrainTileLayer source/resolution, the Box can appear * slightly above or below the visible terrain surface. * - number: fixed absolute altitude in meters. Also not adjusted when terrain tiles load; may not perfectly sit * on the terrain unless both use exactly the same elevation source, datum and resolution. * - 'terrain': sample (clamp to) the current terrain surface height. While the terrain tile is not yet loaded * (or no terrain layer exists) the altitude is 0 and updates once data becomes available. * * Notes: * - Use 'terrain' to keep the Box visually seated on the rendered terrain. * - Use a numeric value for a constant absolute elevation independent of terrain updates. * - To position something N meters above terrain: use 'terrain' plus offsetZ (e.g. offsetZ: '5m'). * - Expect mismatches (floating / sinking) when using true or a fixed number with a different terrain data source. * * @defaultValue false * @experimental */ altitude?: number | boolean | 'terrain' | StyleValueFunction | StyleZoomRange | StyleExpression; /** * Scales the size of a style based on the feature's altitude. * If it's enabled (true), features closer to the camera will be drawn larger than those farther away. * When off (false), the size of the style is always the same size, regardless of its actual altitude, as if it were placed on the ground (altitude 0). * This attribute applies to styles of type "Rect", "Image", "Text", "Circle", "Line", "Box", or "Sphere" whose size ({@link width}, {@link radius}, {@link strokeWidth}) that are using "map" {@link alignment} only. * If the size attribute is defined in meters, scaleByAltitude is enabled by default, for pixels it is disabled. * * @defaultValue false (pixels), true (meters) * * @experimental */ scaleByAltitude?: boolean | StyleValueFunction | StyleZoomRange | StyleExpression; /** * Specifies the name of the light group to use for illuminating specific features on a layer. * This property must reference a key corresponding to a light group defined in {@link LayerStyle.lights}. * A light group consists of lighting sources such as ambient or directional lights that affect the appearance of features. * * If `light` is not defined, the default light group `"defaultLight"` will be used to illuminate the layer's features. * * @see {@link LayerStyle.lights} for defining and referencing available light groups. * * @defaultValue "defaultLight" */ light?: string; /** * Sets the emissive color of the `"Box"`, giving it a glow effect. * * @see {@link Color} for a detailed list of possible supported formats. */ emissive?: Color | StyleValueFunction | StyleZoomRange | StyleExpression; /** * Sets the specular color of the `"Box"`, affecting how it reflects light. * * ### Relationship with Shininess * - **Effect:** The `specular` property determines the color of the light reflection, while the {@link shininess} value controls the intensity and size of the reflection. * - **Shininess Dependency:** If `specular` is set and `shininess` is not explicitly set, the default {@link shininess} value will be used to control the reflection's appearance. * * @see {@link Color} for a detailed list of possible supported formats. */ specular?: Color | StyleValueFunction | StyleZoomRange | StyleExpression; /** * Sets the shininess of the `"Box"`, determining how glossy its surface appears. * A higher value makes the `"Box"` surface more reflective. * * ### Relationship with Specular * - **Effect:** The `shininess` value controls the size and intensity of the specular highlight, which is colored by the {@link specular} property. * - **Specular Dependency:** The `shininess` property enhances the effect of the `specular` color. If `specular` is not set, `shininess` has no visible effect. * * ### Shininess Value Range and Effect * - **Range:** The `shininess` value typically ranges from 0 to 128. * - **Low Values (0-10):** Produce a wide, diffused highlight, resulting in a matte or dull appearance. * - **High Values (50-128):** Produce a small, intense highlight, resulting in a glossy or shiny appearance. * * @defaultValue 32 */ shininess?: number; /** * Controls the intensity of the fill color under directional lighting. * * `fillIntensity` determines how much the `"Box"`'s fill color is affected by the directional lighting in the scene. * A higher value increases the intensity of the fill color, making it more vibrant under strong lighting, * while a lower value reduces the effect, resulting in a more muted color. * * The value should range from 0 to 1, where 0 means no color intensity and 1 represents full intensity. * * @defaultValue 1 */ fillIntensity?: number; } /** * Detailed Information about the build. */ export declare const build: { /** * the name of the api */ readonly name: string; /** * the date when the build was created */ readonly date: number; /** * the git version used for the build. */ readonly revision: string; /** * the version of the build. * uses: Semantic Versioning */ readonly version: string; }; /** * Interface for configuring the visual appearance of Circles. */ export declare interface CircleStyle { /** * Specifies the type of style to render. */ type: 'Circle'; /** * Indicates the drawing order within a layer. * Styles with larger zIndex value are rendered above those with smaller values. * The zIndex is defined relative to the "zLayer" property. * If "zLayer" is defined all zIndex values are relative to the "zLayer" value. */ zIndex: number | StyleValueFunction | StyleZoomRange | StyleExpression; /** * Indicates drawing order across multiple layers. * Styles using zLayer with a high value are rendered on top of zLayers with a low value. * If no zLayer is defined, it will fall back to the {@link LayerStyle.zLayer} or depend on the display layer order. * The first (lowest) layer has a zLayer value of 1. * * @example \{...zLayer: 2, zIndex: 5\} will be rendered on top of \{...zLayer: 1, zIndex: 10\} */ zLayer?: number | StyleValueFunction | StyleExpression; /** * Sets the color to fill the Circle. * * @see {@link Color} for a detailed list of possible supported formats. */ fill?: Color | StyleValueFunction | StyleZoomRange | StyleExpression; /** * Sets the stroke color of the Circle. * * @see {@link Color} for a detailed list of possible supported formats. */ stroke?: Color | StyleValueFunction | StyleZoomRange | StyleExpression; /** * Sets the width of the stroke. * The unit of strokeWidth is defined in pixels. * * @example * ```typescript * // define a Circle that has a strokeWidth of 2 pixels * { * zIndex: 0, * type: "Circle", * stroke: "blue", * strokeWidth: 2, * radius: "1m" * } * ``` */ strokeWidth?: number | string | StyleValueFunction | StyleZoomRange | StyleExpression; /** * Defines the opacity of the style. * The value must be between 0.0 (fully transparent) and 1.0 (fully opaque). * It is valid for all style types. * @defaultValue 1 */ opacity?: number | StyleValueFunction | StyleZoomRange | StyleExpression; /** * The Radius of the Circle. * The default unit is pixels. * To define the radius of a Circle in meters a string can be used: "$\{width\}m". * * @example * ```typescript * // define a Circle with a radius of 1 meter * { * zIndex: 0, * type: "Circle", * fill: "red", * radius: "1m" * } * // define a Circle with a radius of 16 pixel * { * zIndex: 0, * type: "Circle", * fill: "red", * radius: 16 * } * ``` */ radius: number | string | StyleValueFunction | StyleZoomRange | StyleExpression; /** * Offset the Circle in pixels on x-axis. * A positive value offsets to the right, a negative value to the left. * The default unit is pixels. * * @example * ```typescript * // offset Circle by 1m to the left * { type: "Circle", zIndex: 0, fill:'blue', radius: 4, offsetX: "-1m"} * ``` */ offsetX?: number | string | StyleValueFunction | StyleZoomRange | StyleExpression; /** * Offset the Circle in pixels on y-axis. * A positive value offsetY offsets downwards, a negative value upwards. * The default unit is pixels. * * @example * ```typescript * // offset Circle by 1m to the top * { type: "Circle", zIndex: 0, fill:'blue', radius: 4, offsetY: "-1m"} * ``` */ offsetY?: number | StyleValueFunction | StyleZoomRange | StyleExpression; /** * Offset the Circle in pixels on z-axis. * A positive value offsets up, a negative value down. * The default unit is pixels. * * @example * ```typescript * // offset Circle by 1m to the top * { type: "Circle", zIndex: 0, fill:'blue', radius: 4, offsetZ: "1m"} * ``` */ offsetZ?: number | string | StyleValueFunction | StyleZoomRange | StyleExpression; /** * Alignment for styles of type "Circle". * Possible values are: "map" and "viewport". * "map" aligns to the plane of the map and "viewport" aligns to the plane of the viewport/screen. * Default alignment for Text based on point geometries is "viewport" while "map" is the default for line geometries. */ alignment?: 'map' | 'viewport' | StyleValueFunction | StyleZoomRange | StyleExpression; /** * Sets the anchor point for styles of type "Circle" when used with Line or Polygon geometry. * * Possible values for Line geometry are "Coordinate" and "Line". * - "Coordinate": the respective style is displayed at each coordinate of the polyline. * - "Line": the respective style is displayed on the shape of the polyline when there is enough space. See {@link checkLineSpace} to disable the space check. * * Possible values for Polygon geometry are "Center" and "Centroid". * - "Center": the center of the bounding box of the polygon. * - "Centroid": the geometric centroid of the polygon geometry. * * @defaultValue For Polygon geometry the default is "Center". For Line geometry the default is "Coordinate". */ anchor?: 'Line' | 'Coordinate' | 'Centroid' | StyleValueFunction | StyleZoomRange | StyleExpression; /** * Enable or disable the space check for point styles on line geometries. * Only applies to "Circle" styles with {@link anchor} set to "Line". * If check checkLineSpace is enabled the respective style is only displayed if there is enough space on the line, * otherwise it is not displayed. * * @defaultValue true */ checkLineSpace?: boolean | StyleValueFunction | StyleZoomRange | StyleExpression; /** * Enable or disable collision detection. * If the collision detection is enabled for multiple Styles within the same StyleGroup, the respective Styles are * handled as a single Object ("CollisionGroup") where the combined bounding-box is determined automatically. * * - true: collision are allowed, Collision detection is disabled. * - false: avoid collisions, Collision detection is enabled. * * @defaultValue true. */ collide?: boolean | StyleValueFunction | StyleZoomRange | StyleExpression; /** * Enables collision detection and combines all styles of a StyleGroup with the same "CollisionGroup" into a single logical object for collision detection. */ collisionGroup?: string | StyleValueFunction | StyleZoomRange | StyleExpression; /** * Minimum distance in pixels between repeated style-groups on line geometries. * Applies per tile only. * * @defaultValue 256 (pixels) */ repeat?: number | StyleValueFunction | StyleZoomRange | StyleExpression; /** * Altitude of the Circle center in meters. * * Describes the vertical distance from the global ground plane (0m) to the Circle. * * Supported values: * - false (default): place at 0m. * - true: use the altitude (z) from the feature geometry if present, else 0. Not re-aligned to the rendered terrain. * If the geometry altitude source differs from the TerrainTileLayer source/resolution, the Circle can appear * slightly above or below the visible terrain surface. * - number: fixed absolute altitude in meters. Also not adjusted when terrain tiles load; may not perfectly sit * on the terrain unless both use exactly the same elevation source, datum and resolution. * - 'terrain': sample (clamp to) the current terrain surface height. While the terrain tile is not yet loaded * (or no terrain layer exists) the altitude is 0 and updates once data becomes available. * * Notes: * - Use 'terrain' to keep the Circle visually seated on the rendered terrain. * - Use a numeric value for a constant absolute elevation independent of terrain updates. * - To position something N meters above terrain: use 'terrain' plus offsetZ (e.g. offsetZ: '5m'). * - Expect mismatches (floating / sinking) when using true or a fixed number with a different terrain data source. * * @defaultValue false * @experimental */ altitude?: number | boolean | 'terrain' | StyleValueFunction | StyleZoomRange | StyleExpression; /** * Scales the size of a style based on the feature's altitude. * If it's enabled (true), features closer to the camera will be drawn larger than those farther away. * When off (false), the size of the style is always the same size, regardless of its actual altitude, as if it were placed on the ground (altitude 0). * This attribute applies to styles of type "Rect", "Image", "Text", "Circle", "Line", "Box", or "Sphere" whose size ({@link width}, {@link radius}, {@link strokeWidth}) that are using "map" {@link alignment} only. * If the size attribute is defined in meters, scaleByAltitude is enabled by default, for pixels it is disabled. * * @defaultValue false (pixels), true (meters) * * @experimental */ scaleByAltitude?: boolean | StyleValueFunction | StyleZoomRange | StyleExpression; } /** * This Feature represents a Cluster. */ export declare class ClusterFeature extends Feature<'Point'> { /** * The Properties of the Cluster feature. */ properties: ClusterFeatureProperties; /** * The geometry of a cluster feature is of type 'Point', * where the `coordinates` represent the geographical coordinates [longitude, latitude] of the cluster center. */ geometry: { type: 'Point'; coordinates: GeoJSONCoordinate; }; /** * Returns the features within the cluster. * @returns An array containing the features within the cluster. */ getFeatures(): any; /** * Calculates and returns the bounding box of the cluster. * @returns The bounding box of the cluster. */ getClusterBBox(): GeoJSONBBox; } /** * Properties of a ClusterFeature. * * The `isCluster`, `clusterSize`, and `zoom` properties are automatically populated for each cluster feature. * * Custom properties aggregation for clusters can be achieved by defining custom property creation and aggregation functions using the {@link ClusterTileLayerOptions.createProperties|createProperties} and {@link ClusterTileLayerOptions.aggregateProperties|aggregateProperties} options. */ export declare type ClusterFeatureProperties = { /** * Indicates if the feature is a cluster. */ readonly isCluster: true; /** * The size of the cluster, i.e., the number of features it contains. */ readonly clusterSize: number; /** * The zoom level at which the cluster was formed. */ readonly zoom: number; /** * Additional custom properties of the cluster feature. */ [name: string]: any; }; /** * The `ClusterTileLayer` class is a specialized TileLayer designed to efficiently handle clustering of GeoJSON data from various DataSources/DataProviders. * * This layer aggregates data points within map tiles to reduce visual clutter and improve performance, particularly when dealing with large datasets. * When features are being added or removed from the DataSources, the ClusterTileLayer automatically updates to reflect the changes. * Data will be clustered for each zoom level optimally from {@link ClusterTileLayerOptions.min | min} up to {@link ClusterTileLayerOptions.clusterMaxZoom | clusterMaxZoom}. * For zoom levels below {@link ClusterTileLayerOptions.clusterMaxZoom | clusterMaxZoom} and upto {@link ClusterTileLayerOptions.min | min}, the untouched source data features will be displayed. * * Additionally, the `ClusterTileLayer` supports cluster property aggregation, allowing developers to customize how properties are aggregated when features are added or removed from the cluster. * The following methods are available for property aggregation: * * - `createProperties(featureProperties: { [propertyName: string]: any }): { [propertyName: string]: any }`: Creates initial properties for a cluster based on the properties of a feature. * * - `addProperties(clusterProperties: { [propertyName: string]: any }, featureProperties: { [propertyName: string]: any }): void`: Updates cluster properties when a feature is added to the cluster. * * - `removeProperties(clusterProperties: { [propertyName: string]: any }, featureProperties: { [propertyName: string]: any }): void`: Updates cluster properties when a feature is removed from the cluster. * * This layer also utilizes the {@link ClusterFeature} class to represent clusters. * * @see ClusterFeature * * @example * ``` * // Create a new ClusterTileLayer with specified options * const myLayer = new ClusterTileLayer({ * min: 2, // Minimum zoom level to cluster and display the layer * max: 20, // Maximum zoom level the layer will be displayed * clusterMaxZoom:13, // the maximum zoom level data will be clustered * clusterRadius: 15, // Cluster radius in pixels * provider: myDataProvider // The data provider that data should be clustered * }); * ``` */ export declare class ClusterTileLayer extends TileLayer { /** * @param options - options to configure the ClusterTileLayer */ constructor(options: ClusterTileLayerOptions); /** * Retrieves the data provider associated with this ClusterTileLayer. * * The data provider is responsible for supplying the features that are * to be clustered and displayed within the ClusterTileLayer. * * @returns The `FeatureProvider` instance used by this layer. */ getDataProvider(): FeatureProvider; /** * Clears the {@link ClusterTileLayerOptions.provider | source data provider} and all associated clusters, optionally within a specified bounding box. * * If no bounding box is provided, all features in the source dataProvider and all clusters will be cleared. * * @param {GeoJSONBBox} [bbox] - Optional. The bounding box defining the area to clear. */ clear(bbox?: GeoJSONBBox): any; /** * Retrieves the cluster to which the specified feature belongs at the given zoom level. * @param feature The feature for which to retrieve the cluster. * @param zoom The zoom level. If not specified, the current map zoom level will be used. * @returns The cluster feature to which the specified feature belongs, or `undefined` if no cluster exists. */ getCluster(feature: Feature<'Point'>, zoom?: number): ClusterFeature; /** * Retrieves all clusters to which the specified feature belongs across all zoom levels. * The returned array is ordered by zoom level in descending order, starting from the {@link ClusterTileLayerOptions.clusterMaxZoom}. * * @param feature The feature for which to retrieve all clusters. * @returns An array of cluster features to which the specified feature belongs, ordered by zoom level. */ getClusters(feature: Feature<'Point'>): any[]; } /** * Options for configuring a ClusterTileLayer. */ export declare interface ClusterTileLayerOptions extends TileLayerOptions { /** * The data provider supplying the data to be clustered. */ provider: FeatureProvider; /** * Determines whether pointer events are enabled for all features of the layer. * @defaultValue false */ pointerEvents?: boolean; /** * The maximum zoom level at which data from the TileLayer will be displayed. */ max?: number; /** * Defines the radius, in pixels, within which features should be clustered. * The default value is 32 pixels. * * @defaultValue 32 */ clusterRadius?: number; /** * Specifies the maximum zoom level at which data should be clustered. * If not defined, it defaults to zoom level 13. * When the map zoom level exceeds the `clusterMaxZoom`, raw data features will be displayed instead of clusters. * * @defaultValue 13 */ clusterMaxZoom?: number; /** * This function generates the initial properties of a cluster. * Please note that defined Properties in ClusterFeatureProperties are considered as readonly and are not allowed to be set. * If the function is not defined, the default implementation returns an empty object. */ createProperties?: (feature: { [name: string]: any; }) => ClusterFeatureProperties; /** * Use this function to aggregate cluster properties whenever a feature is being added or removed to the cluster. * * @param clusterProperties The properties of the cluster. * @param featureProperties The properties of the feature being added or removed. * @param operation The operation being performed ('add' or 'remove'). */ aggregateProperties?: (clusterProperties: ClusterFeatureProperties, featureProperties: { [name: string]: any; }, operation: 'add' | 'remove') => void; } /** * The Color is an RGBA color value representing RED, GREEN, and BLUE light sources with an optional alpha channel. * Colors can be specified in the following ways: * - CSS color names: "red" * - RGB colors: "rgb(255,0,0)" * - RGBA colors: "rgba(255,0,0,1.0)" * - Hexadecimal colors: "#ff0000" | "#f00" * - Hexadecimal colors with transparency: "#ff0000ff" * - hexadecimal numbers: 0xff0000 * - RGBA Color Array: [1.0, 0.0, 0.0, 1.0] */ export declare type Color = string | number | [number, number, number, number?]; /** * The CustomLayer can be used to integrate custom renderers to the map display. */ export declare class CustomLayer extends Layer { /** * Options to configure the renderer. */ renderOptions: { /** * The used rendering mode. * Use '2d' for traditional flat map layers that are located on the ground-plane, otherwise '3d'. * * @DefaultValue: '2d' */ mode?: '2d' | '3d' | string; /** * Indicates the drawing order within the layer. * Styles with larger zIndex value are rendered above those with smaller values. * The zIndex is defined relative to the "zLayer" property. * If "zLayer" is defined all zIndex values are relative to the "zLayer" value. */ zIndex?: number; /** * Indicates drawing order across multiple layers. * Styles using zLayer with a high value are rendered on top of zLayers with a low value. * If no zLayer is defined the zLayer depends on the display layer order. * The first (lowest) layer has a zLayer value of 1. * * @example \{...zLayer: 2, zIndex: 5\} will be rendered on top of \{...zLayer: 1, zIndex: 10\} */ zLayer?: number; }; /** * @param options - options to configure the CustomLayer */ constructor(options?: CustomLayerOptions); /** * Event Listener that will be called when the layer is added to the display. * @param ev - Event of type "layerAdd" */ onLayerAdd(ev: CustomEvent): void; /** * Event Listener that will be called when the layer is removed from the display. * @param ev - Event of type "layerRemove" */ onLayerRemove(ev: CustomEvent): void; /** * The render function will be called each frame. * It enables seamless drawing into the rendering context of the map. * The context states are correctly set already to allow "simple" drawing at the respective zIndex/zLayer. * The camera matrix projects from the world coordinate system (WebMercator projected, topLeft [0,0] -> bottomRight [1,1]) to the clipspace. * * @param context - the rendering context of the map. * @param matrix - the camera matrix of the map. */ render(context: WebGLRenderingContext | CanvasRenderingContext2D, matrix: Float64Array): void; } /** * Options to configure the CustomLayer. */ declare interface CustomLayerOptions extends LayerOptions { /** * Event Listener that will be called when the layer is added to the display. * @param ev - Event of type "layerAdd" */ onLayerAdd?(ev: CustomEvent): any; /** * Event Listener that will be called when the layer is removed from the display. * @param ev - Event of type "layerRemove" */ onLayerRemove?(ev: CustomEvent): any; /** * Options to configure the renderer. */ renderOptions?: { /** * The used rendering mode. * Use '2d' for traditional flat map layers that are located on the ground-plane, otherwise '3d'. * * @DefaultValue: '2d' */ mode?: '2d' | '3d' | string; /** * Indicates the drawing order within the layer. * Styles with larger zIndex value are rendered above those with smaller values. * The zIndex is defined relative to the "zLayer" property. * If "zLayer" is defined all zIndex values are relative to the "zLayer" value. */ zIndex?: number; /** * Indicates drawing order across multiple layers. * Styles using zLayer with a high value are rendered on top of zLayers with a low value. * If no zLayer is defined the zLayer depends on the display layer order. * The first (lowest) layer has a zLayer value of 1. * * @example \{...zLayer: 2, zIndex: 5\} will be rendered on top of \{...zLayer: 1, zIndex: 10\} */ zLayer?: number; }; /** * The render function will be called each frame. * It enables seamless drawing into the rendering context of the map. * The context states are correctly set already to allow "simple" drawing at the respective zIndex/zLayer. * The camera matrix projects from the world coordinate system (WebMercator projected, topLeft [0,0] -> bottomRight [1,1]) to the clipspace. * * @param context - the rendering context of the map. * @param matrix - the camera matrix of the map. */ render?(context: WebGLRenderingContext | CanvasRenderingContext2D, matrix: Float64Array): any; } /** * Represents a structured attribution entry for a data source. * * Used to provide detailed attribution information for map layers, supporting clickable labels and optional tooltips. * * @property label - The text label displayed in the attribution control. * @property url - (Optional) A URL that opens when the label is clicked. * @property title - (Optional) Tooltip shown on hover over the label. */ declare type DataSourceAttribution = { /** * The text label displayed in the attribution control. */ label: string; /** * (Optional) A URL that opens when the label is clicked. */ url?: string; /** * (Optional) Tooltip shown on hover over the label. */ title?: string; }; /** * The `DirectionalLight` interface represents directional lighting, which simulates light coming from a specific direction. * * @extends Light */ export declare interface DirectionalLight extends Light { /** * The type of light. For `DirectionalLight`, this is always 'directional'. */ type: 'directional'; /** * The direction of the light, represented as a vector. This determines the direction from which the light is coming. */ direction: number[]; } /** * EditableFeatureProvider is an abstract FeatureTileProvider that can be edited using the {@link Editor} module. */ export declare abstract class EditableFeatureProvider extends FeatureProvider { /** * Hook functions that will be called during the execution of the corresponding "editing operation". * The "hooks" property is a map with the "editing operation" as its key and the corresponding Hook or Array of Hook function(s) as its value. * * Available editing operations are 'Navlink.disconnect', 'Navlink.split', 'Feature.remove', 'Coordinates.remove'. * * @see {@link editor.Editor.addHook | editor.addHook } */ hooks?: { 'Navlink.split'?: NavlinkSplitHook | NavlinkSplitHook[]; 'Navlink.disconnect'?: NavlinkDisconnectHook | NavlinkDisconnectHook[]; 'Feature.remove'?: FeatureRemoveHook | FeatureRemoveHook[]; 'Coordinates.update'?: CoordinatesUpdateHook | CoordinatesUpdateHook[]; }; /** * This method is used to determine the {@link editor.Feature.class | FeatureClass} required to edit the feature. * The {@link editor.Feature.class | FeatureClass} defines how a certain feature behaves when its getting edited. * * By default, the {@link editor.Editor Editor} handles all features of geometry type 'LineString' as {@link editor.Line | Line}, 'Point' as {@link editor.Marker | Marker} and '(Multi)Polygon' as {@link editor.Area | Area}. * * If you want to edit features with {@link editor.Feature.class | FeatureClass} 'NAVLINK', 'PLACE' or 'ADDRESS' this method must be overridden to enable editing of {@link editor.Navlink | Navlinks}, {@link editor.Place | Places} or {@link editor.Address | Addresses}. * * @param feature - The feature whose {@link editor.Feature.class | FeatureClass} is requested * * @returns the FeatureClass of the feature, or null if the feature should not be editable. */ detectFeatureClass(feature: Feature): 'LINE' | 'NAVLINK' | 'MARKER' | 'PLACE' | 'ADDRESS' | 'AREA' | string | null; /** * Attribute reader for obtaining the zLevels of a Navlink feature. * * This method must be implemented to enable editing of {@link editor.Navlink | Navlinks}. * * @param navlink - the Navlink whose zLevels are requested * * @return An array containing the zLevel for each coordinate of the Navlink. */ abstract readZLevels(navlink: Navlink): number[]; /** * Attribute writer for writing the zLevels of a Navlink feature. * * This method must be implemented to enable editing of {@link editor.Navlink | Navlinks}. * * @param navlink - the Navlink whose zLevels should be set * @param zLevels - An array containing the zLevel for each coordinate of the Navlink * * @return An array containing the zLevel for each coordinate of the Navlink. */ abstract writeZLevels(navlink: Navlink, zLevels: number[]): any; /** * Attribute reader for obtaining the direction of travel of a Navlink feature. * * This method must be implemented to enable editing of {@link editor.Navlink | Navlinks}. * * @param navlink - the Navlink whose direction is requested */ abstract readDirection(navlink: Navlink): 'BOTH' | 'START_TO_END' | 'END_TO_START'; /** * Attribute reader for obtaining if a Navlink feature can be accessed by pedestrians only. * * This method must be implemented to enable editing of {@link editor.Navlink | Navlinks}. * * @param navlink - the Navlink * * @returns true, if the Navlink can be accessed by pedestrians only, otherwise false. */ abstract readPedestrianOnly(navlink: Navlink): boolean; /** * Attribute reader for obtaining the turn-restrictions of two Navlink Features. * * This method must be implemented to enable editing of {@link editor.Navlink | Navlinks}. * * @param turnFrom - The Navlink and it's coordinate index from which to turn from * @param turnTo - The Navlink and it's coordinate index to which you want to turn * * @returns true if turn is allowed, otherwise false. */ abstract readTurnRestriction(turnFrom: { link: Navlink; index: number; }, turnTo: { link: Navlink; index: number; }): boolean; /** * Attribute writer for writing a turn restriction between two Navlink features. * * This method must be implemented to enable editing of {@link editor.Navlink | Navlinks}. * It defines whether a turn from one Navlink to another is permitted or restricted. * * @param restricted - Specifies whether the turn is forbidden (`true`) or allowed (`false`). * @param turnFrom - The originating Navlink and its coordinate index from which the turn starts. * @param turnTo - The destination Navlink and its coordinate index to which the turn is directed. */ abstract writeTurnRestriction(restricted: boolean, turnFrom: { link: Navlink; index: number; }, turnTo: { link: Navlink; index: number; }): any; /** * Attribute reader for obtaining the id of the TileProvider containing the corresponding Navlink, of an Address or Place feature, on which the RoutingPoint is located. * * This method must be implemented to enable editing of {@link editor.Place | Places} or {@link editor.Address | Addresses}. * * @param feature - The Address or Place feature whose RoutingProvider is requested. * * @returns the Id of the TileProvider in which the object is stored. If undefined is returned, the RoutingPoint's Navlink is assumed to be in the same TileProvider as the Address/Place. */ abstract readRoutingProvider(feature: Feature): string | undefined; /** * Attribute reader for obtaining the RoutingPoint's geographical position of an Address or Place. * The geographical position must be located on the geometry of the related Navlink feature. * * This method must be implemented to enable editing of {@link editor.Place | Places} or {@link editor.Address | Addresses}. * * @param feature - The Address or Place feature whose RoutingProvider is requested. * * @returns GeoJSON Coordinate representing the geographical position of the RoutingPoint or null if a Place does not have a RoutingPoint. */ abstract readRoutingPosition(feature: Feature): GeoJSONCoordinate | null; /** * Attribute reader for obtaining the id of the Navlink Feature on which the RoutingPoint of an Address or Place feature is located. * For Addresses an Id must be returned. If null is returned for a Place, the Place is treated as "floating" without a RoutingPoint. * * This method must be implemented to enable editing of {@link editor.Place | Places} or {@link editor.Address | Addresses}. * * @param feature - The Address or Place of which the Navlink of the RoutingPoint is requested. * * @returns the Id of the Navlink on which the RoutingPoint is located. */ abstract readRoutingLink(feature: Feature): NavlinkId | null; /** * Attribute writer to store the RoutingPoint's geographical position of an Address or Place. * The geographical position must be located on the geometry of the related Navlink feature. * * This method must be implemented to enable editing of {@link editor.Place | Places} or {@link editor.Address | Addresses}. * * @param feature - The Address or Place feature whose RoutingPoint position to write. * @param position - the geographical position of the RoutingPoint. */ abstract writeRoutingPosition(feature: Feature, position: GeoJSONCoordinate | null): any; /** * Attribute writer for storing the Navlink reference on which the RoutingPoint of an Address or Place feature is located. * * This method must be implemented to enable editing of {@link editor.Place | Places} or {@link editor.Address | Addresses}. * * @param feature - The Address or Place of which the Navlink reference of the RoutingPoint to store. * @param navlink - The navlink whose reference is to be written, or null in case of a Place becomes "floating" and has no RoutingPoint. * */ abstract writeRoutingLink(feature: Feature, position: any, navlink: Navlink | null): any; /** * Attribute writer for storing the EditStates of a Feature. * The EditStates provide information about whether a feature has been created, modified, removed or split. * * By default EditStates aren't tracked/stored. * * @param feature - The Feature whose EditState should be written. * @param editState - the EditState to store */ abstract writeEditState(feature: Feature, editState: 'created' | 'modified' | 'removed' | 'split'): any; /** * Attribute reader for obtaining the Height of a Building (extruded {@link editor.Area | Area}). * The height must be specified in meters. * * This method must be implemented to enable editing of the height of an extruded {@link editor.Area | Area}. * * @param feature - The Area feature whose height is requested. * * @returns The height in meters of the Building/Area or null if the Area is considered flat. */ abstract readFeatureHeight(feature: Feature): number | null; /** * Attribute writer for storing the Height of a Building (extruded {@link editor.Area | Area}). * The height must be specified in meters. * * This method must be implemented to enable editing of the height of an extruded {@link editor.Area | Area}. * * @param feature - The Area feature whose height should be updated/written. * @param height - The height specified in meters * */ abstract writeFeatureHeight(feature: Feature, height: number | null): any; } /** * Configuration options of a EditableFeatureProviderOptions. */ declare interface EditableFeatureProviderOptions extends TileProviderOptions { /** * Allow or prevent editing by the {@link editor.Editor | Editor} module. * * @defaultValue false */ editable?: boolean; /** * Enforce random ids for newly created features. * If "enforceRandomFeatureId" is set to true, the ids of features created by {@link editor.Editor.addFeature | editor.addFeature} are ignored and randomly created. * If "enforceRandomFeatureId" is set to false, ids of features created by {@link editor.Editor.addFeature | editor.addFeature} can be set. Random ids are only generated if none have been set. * * @defaultValue true */ enforceRandomFeatureId?: boolean; /** * Add hook functions that will be called during the execution of the corresponding "editing operation". * The "hooks" option is a map with the "editing operation" as its key and the corresponding Hook or Array of Hook function(s) as its value. * * Available editing operations are 'Navlink.disconnect', 'Navlink.split', 'Feature.remove', 'Coordinates.remove'. * * @see {@link editor.Editor.addHook | editor.addHook} */ hooks?: { /** * The NavlinkSplitHook(s) will be called whenever a Navlink is devided into two new Navlinks. ('Navlink.split' operation). */ 'Navlink.split'?: NavlinkSplitHook | NavlinkSplitHook[]; /** * The NavlinkDisconnectHook(s) will be called whenever a Navlink is disconnected from an intersection ('Navlink.disconnect' operation). */ 'Navlink.disconnect'?: NavlinkDisconnectHook | NavlinkDisconnectHook[]; /** * The FeatureRemoveHook(s) will be called when a feature is being removed ('Feature.remove' operation). */ 'Feature.remove'?: FeatureRemoveHook | FeatureRemoveHook[]; /** * The CoordinatesUpdateHook(s) will be called whenever the coordinates of a feature are added, updated or removed ('Coordinates.update' operation). */ 'Coordinates.update'?: CoordinatesUpdateHook | CoordinatesUpdateHook[]; }; } /** * EditableRemoteTileProvider is a remote tile provider that can be edited using the {@link Editor} module. */ export declare abstract class EditableRemoteTileProvider extends EditableFeatureProvider { /** * @param options - options to configure the provider */ protected constructor(options: EditableRemoteTileProviderOptions); /** * Gets features from provider by id. * * @param ids - array of feature ids to search for. * @param options - search options * * @returns if just a single feature is found its getting returned otherwise an array of features or undefined if none is found. */ getFeatures(ids: number[] | string[], options?: { /** * Force the provider to do remote search if no result is found in local cache. */ remote?: boolean; /** * Callback function for "remote" search. * @param result - array of Features containing the search result. */ onload?: (result: Feature[] | null) => void; }): any; /** * Gets features from provider by id. * * @param options - search options * * @returns if just a single feature is found its getting returned otherwise an array of features or undefined if none is found. */ getFeatures(options: { /** * search for a single feature by id */ id?: number | string; /** * array of ids to search for multiple features */ ids?: number[] | string[]; /** * Force the provider to do remote search if no result is found in local cache */ remote?: boolean; /** * Callback function for "remote" search * @param result - Result array of features */ onload?: (result: Feature[] | null) => void; }): any; /** * Cancel ongoing request(s) of a tile. * The tile will be dropped. * * @param quadkey - the quadkey of the tile that should be canceled and removed. */ cancel(quadkey: string): void; /** * Cancel ongoing request(s) of a tile. * The tile will be dropped. * * @param tile - the tile that should be canceled and removed. */ cancel(tile: Tile): void; /** * Search for feature(s) in the provider. * * @param options - configure the search * * @example * ``` * // searching by ids: * provider.search({ids: [1058507462, 1058507464]}) * * // searching by point and radius: * provider.search({ * point: {longitude: 72.84205, latitude: 18.97172}, * radius: 100 * }) * * // searching by Rect: * provider.search({ * rect: {minLon: 72.83584, maxLat: 18.97299, maxLon: 72.84443, minLat: 18.96876} * }) * * // remote search: * provider.search({ * rect: {minLon: 72.83584, maxLat: 18.97299, maxLon: 72.84443, minLat: 18.96876}, * remote: true, // force provider to do remote search if feature/search area is not cached locally * onload: (result) => {...} * }) * ``` * @returns array containing the searched features */ search(options: { /** * Search features by Ids. */ ids?: number[] | string[]; /** * Geographical center point of the circle to search in. options.radius must be defined. */ point?: GeoPoint | GeoJSONCoordinate; /** * Radius of the circle in meters, it is used in "point" search. */ radius?: number; /** * Geographical Rectangle to search in. [minLon, minLat, maxLon, maxLat] | GeoRect. */ rect?: GeoRect | GeoJSONBBox; /** * Force the data provider(s) to do remote search if no result is found in local cache. */ remote?: boolean; /** * Callback function for "remote" search. * @param result - Array of Features containing the search results. */ onload?: (result: Feature[] | null) => void; /** * Function to be called when a request of a "remote search" fails. */ onerror?: (error: { /** * The name property represents a name for the type of error. The value is "NetworkError". */ name: 'NetworkError'; /** * The error message of the failing request. */ message: string; /** * The responseText which contains the textual data received of the failing request. */ responseText: string; /** * The numerical HTTP status code of the failing request. */ status: number; }) => void; }): Feature[]; /** * Search for feature(s) in the provider. * * @param options - configure the search * * @example * ``` * // searching by id: * provider.search({id: 1058507462}) * * // remote search: * provider.search({ * id: 1058507462, * remote: true, // force provider to do remote search if feature/search area is not cached locally * onload: (result) => {...} * }) * ``` * @returns array containing the searched features */ search(options: { /** * search feature by id. */ id: number | string; /** * Force the data provider(s) to do remote search if no result is found in local cache. */ remote?: boolean; /** * Callback function for "remote" search. * @param result - Array of Features containing the search results. */ onload?: (result: Feature | null) => void; /** * Function to be called when a request of a "remote search" fails. */ onerror?: (error: { /** * The name property represents a name for the type of error. The value is "NetworkError". */ name: 'NetworkError'; /** * The error message of the failing request. */ message: string; /** * The responseText which contains the textual data received of the failing request. */ responseText: string; /** * The numerical HTTP status code of the failing request. */ status: number; }) => void; }): Feature; /** * Point Search for feature(s) in provider. * @param point - Geographical center point of the point to search in. options.radius must be defined. * @param options - configure the search * * @example * ``` * layer.search({longitude: 72.84205, latitude: 18.97172},{ * radius: 100 * }) * // or: * layer.search([72.84205, 18.97172], { * radius: 100 * }) * ``` */ search(point: GeoPoint | GeoJSONCoordinate, options?: { /** * the radius of the circular area in meters to search in */ radius: number; /** * Force the data provider(s) to do remote search if no result is found in local cache. */ remote?: boolean; /** * Callback function for "remote" search. * @param result - Array of Features containing the search results. */ onload?: (result: Feature[] | null) => void; /** * Function to be called when a request of a "remote search" fails. */ onerror?: (error: { /** * The name property represents a name for the type of error. The value is "NetworkError". */ name: 'NetworkError'; /** * The error message of the failing request. */ message: string; /** * The responseText which contains the textual data received of the failing request. */ responseText: string; /** * The numerical HTTP status code of the failing request. */ status: number; }) => void; }): Feature[]; /** * Rectangle Search for feature(s) in the provider. * @param rect - Geographical Rectangle to search in. [minLon, minLat, maxLon, maxLat] | GeoRect. * @param options - configure the search * * @example * ``` * provider.search({minLon: 72.83584, maxLat: 18.97299, maxLon: 72.84443, minLat: 18.96876}) * // or: * provider.search([72.83584, 18.96876, 72.84443,18.97299]) * * // remote search: * provider.search({minLon: 72.83584, maxLat: 18.97299, maxLon: 72.84443, minLat: 18.96876}, { * remote: true, // force provider to do remote search if search area is not cached locally * onload: (result) => {...} * }) * ``` */ search(rect: GeoRect | GeoJSONBBox, options?: { /** * Force the data provider(s) to do remote search if no result is found in local cache. */ remote?: boolean; /** * Callback function for "remote" search. * @param result - Array of Features containing the search results. */ onload?: (result: Feature[] | null) => void; /** * Function to be called when a request of a "remote search" fails. */ onerror?: (error: { /** * The name property represents a name for the type of error. The value is "NetworkError". */ name: 'NetworkError'; /** * The error message of the failing request. */ message: string; /** * The responseText which contains the textual data received of the failing request. */ responseText: string; /** * The numerical HTTP status code of the failing request. */ status: number; }) => void; }): Feature[]; /** * Search for feature by id in the provider. * * @param id - id of the feature to search for * @param options - configure the search * * @example * ``` * provider.search(1058507462) * * // remote search: * provider.search(1058507462,{ * remote: true, // force provider to do remote search if search area is not cached locally * onload: (result) => {...} * }) * ``` */ search(id: string | number, options?: { /** * Force the data provider(s) to do remote search if no result is found in local cache. */ remote?: boolean; /** * Callback function for "remote" search. * @param result - Array of Features containing the search results. */ onload?: (result: Feature) => void; /** * Function to be called when a request of a "remote search" fails. */ onerror?: (error: { /** * The name property represents a name for the type of error. The value is "NetworkError". */ name: 'NetworkError'; /** * The error message of the failing request. */ message: string; /** * The responseText which contains the textual data received of the failing request. */ responseText: string; /** * The numerical HTTP status code of the failing request. */ status: number; }) => void; }): Feature; /** * Get a tile by quadkey. * If the tile is not cached already, it will be created and stored automatically. * Data will be fetched from remote data-sources and attached to tile automatically * * @param quadkey - quadkey of the tile * @param callback - will be called as soon as tile is ready for consumption * @returns the Tile */ getTile(quadkey: string, cb: (tile: Tile) => void): any; /** * Commit modified/removed features to the remote backend. * * @param data - the data that should be commit to the remote. * @param onSuccess - callback function that will be called when data has been commit successfully * @param onError - callback function that will be called when an error occurs */ abstract commit(data: { /** * features that should be created or updated */ put?: GeoJSONFeature[]; /** * features that should be removed */ remove?: GeoJSONFeature[]; }, onSuccess?: any, onError?: any, transactionId?: string): any; /** * Attribute writer for storing the EditStates of a Feature. * The EditStates provide information about whether a feature has been created, modified, removed or split. * * By default EditStates aren't tracked/stored. * * @param feature - The Feature whose EditState should be written. * @param editState - the EditState to store */ writeEditState(feature: any, editState: 'created' | 'modified' | 'removed' | 'split'): void; } /** * Options to configure an EditableRemoteTile. */ export declare interface EditableRemoteTileProviderOptions extends RemoteTileProviderOptions { /** * Allow or prevent editing by the {@link editor.Editor} module. * * @defaultValue false */ editable?: boolean; /** * Enforce random ids for newly created features. * If "enforceRandomFeatureId" is set to true, the ids of features created by {@link editor.Editor.addFeature | editor.addFeature} are ignored and randomly created. * If "enforceRandomFeatureId" is set to false, ids of features created by {@link editor.Editor.addFeature | editor.addFeature} can be set. Random ids are only generated if none have been set. * * @defaultValue true */ enforceRandomFeatureId?: boolean; /** * Add hook functions that will be called during the execution of the corresponding "editing operation". * The "hooks" option is a map with the "editing operation" as its key and the corresponding Hook or Array of Hook function(s) as its value. * * Available editing operations are 'Navlink.disconnect', 'Navlink.split', 'Feature.remove', 'Coordinates.remove'. * * @see {@link editor.Editor.addHook} */ hooks?: { /** * The NavlinkSplitHook(s) will be called whenever a Navlink is devided into two new Navlinks. ('Navlink.split' operation). */ 'Navlink.split'?: NavlinkSplitHook | NavlinkSplitHook[]; /** * The NavlinkDisconnectHook(s) will be called whenever a Navlink is disconnected from an intersection ('Navlink.disconnect' operation). */ 'Navlink.disconnect'?: NavlinkDisconnectHook | NavlinkDisconnectHook[]; /** * The FeatureRemoveHook(s) will be called when a feature is being removed ('Feature.remove' operation). */ 'Feature.remove'?: FeatureRemoveHook | FeatureRemoveHook[]; /** * The CoordinatesUpdateHook(s) will be called whenever the coordinates of a feature are added, updated or removed ('Coordinates.update' operation). */ 'Coordinates.update'?: CoordinatesUpdateHook | CoordinatesUpdateHook[]; }; staticData?: boolean; } /** * represents a Feature in GeoJSON Feature format. */ export declare class Feature implements GeoJSONFeature { /** * id of the feature. */ id: string | number; /** * The properties associated with the feature. */ properties: { [name: string]: any; } | null; /** * The type of the feature is a string with 'Feature' as its value. */ type: 'Feature' | string; /** * A geometry is a object where the type member's value is one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon" or "MultiPolygon". * A geometry object must have a member with the name "coordinates". * The value of the coordinates member is always an array (referred to as the coordinates array below). * The structure for the elements in this array are determined by the type of geometry. * * For type "Point", each element in the coordinates array is a number representing the point coordinate in one dimension. * There must be at least two elements, and may be more. * The order of elements must follow x, y, z order (or longitude, latitude, altitude for coordinates in a geographic coordinate reference system). * * For type "MultiPoint", each element in the coordinates array is a coordinates array as described for type "Point". * * For type "LineString", each element in the coordinates array is a coordinates array as described for type "Point". * The coordinates array for a LineString must have two or more elements. * A LinearRing is a special case of type LineString where the first and last elements in the coordinates array are equivalent (they represent equivalent points). * Though a LinearRing is not explicitly represented as a geometry type, it is referred to in the Polygon geometry type definition. * * For type "MultiLineString", each element in the coordinates array is a coordinates array as described for type "LineString". * * For type "Polygon", each element in the coordinates array is a coordinates array as described for type "LineString". * Furthermore, each LineString in the coordinates array must be a LinearRing. * For Polygons with multiple LinearRings, the first must be the exterior ring and any others must be interior rings or holes. * * For type "MultiPolygon", each element in the coordinates array is a coordinates array as described for type "Polygon". * * * ``` * Point: * { * "type": "Point", * "coordinates": [100.0, 0.0] * } * * Polygon: * { * "type": "Polygon", * "coordinates": [ * [ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ] * ] * } *``` */ geometry: { type: 'Point' | 'MultiPoint' | 'LineString' | 'MultiLineString' | 'Polygon' | 'MultiPolygon' | GeometryType | string; coordinates: GeometryType extends 'Point' ? GeoJSONCoordinate : GeometryType extends 'MultiPoint' ? GeoJSONCoordinate[] : GeometryType extends 'LineString' ? GeoJSONCoordinate[] : GeometryType extends 'MultiLineString' ? GeoJSONCoordinate[][] : GeometryType extends 'Polygon' ? GeoJSONCoordinate[][] : GeometryType extends 'MultiPolygon' ? GeoJSONCoordinate[][][] : GeoJSONCoordinate | GeoJSONCoordinate[] | GeoJSONCoordinate[][] | GeoJSONCoordinate[][][]; }; /** * Bounding box of the feature. * The value of the bbox member is an array of length 4, with all axes of the most southwesterly point followed by all axes of the more northeasterly point. * The "bbox" values define shapes with edges that follow lines of constant longitude and latitude. */ bbox?: [number, number, number, number]; /** * Get the Feature as a JSON Object. */ toJSON(): GeoJSONFeature; /** * Get The FeatureProvider where the Feature is stored in. */ getProvider(): FeatureProvider; } /** * Feature provider. * */ export declare class FeatureProvider extends TileProvider { /** * @param options - options to configure the provider */ constructor(options: TileProviderOptions); /** * Add a feature to the provider. * * @param feature - the feature to be added to the provider * * @example * ``` * // add a feature to the provider. * provider.addFeature({ * type: "Feature" * geometry: { * coordinates: [[-122.49373, 37.78202], [-122.49263, 37.78602]], * type: "LineString" * } * }); * ``` */ addFeature(feature: GeoJSONFeature | Feature): Feature; /** * Add multiple features to the provider. * * @param feature - the features to be added to the provider * * @example * ``` * // add multiple features to the provider. * provider.addFeature([{ * type: "Feature" * geometry: { * coordinates: [[-122.49373, 37.78202], [-122.49263, 37.78602]], * type: "LineString" * } * },{ * type: "Feature" * geometry: { * coordinates: [[-122.49375, 37.78203], [-122.49265, 37.78604]], * type: "LineString" * } * }]); * ``` */ addFeature(feature: GeoJSONFeatureCollection | GeoJSONFeature[]): Feature[]; /** * Add an EventListener to the provider. * Valid events: "featureAdd", "featureRemove", "featureCoordinatesChange", "clear" and "error" * * The detail property of the Event gives additional information about the event. * detail.provider is a reference to the provider onto which the event was dispatched and is set for all events. * * @param type - A string representing the event type to listen for * @param listener - the listener function that will be called when an event of the specific type occurs */ addEventListener(type: string, listener: (e: CustomEvent) => void, _c?: any): boolean; /** * Remove an EventListener from the provider. * Valid events: "featureAdd", "featureRemove", "featureCoordinatesChange", "clear" and "error" * * @param type - A string which specifies the type of event for which to remove an event listener. * @param listener - The listener function of the event handler to remove from the provider. */ removeEventListener(type: string, listener: (event: CustomEvent) => void, _c?: any): boolean; /** * Get all the features that are currently present in the provider. */ all(): Feature[]; /** * Gets a feature from the provider by id. * * @param id - the id of the feature * * @returns the found feature or undefined if feature is not present. */ getFeature(id: string | number): Feature | undefined; /** * Gets features from provider by id. * * @param ids - array of feature ids to search for. * @returns if just a single feature is found its getting returned otherwise an array of features or undefined if none is found. */ getFeatures(ids: string[] | number[]): Feature[] | Feature | undefined; /** * Get a tile by quadkey. * If the tile is not cached already, it will be created and stored automatically. * * @param quadkey - quadkey of the tile * @param callback - the callback function * @returns the Tile */ getTile(quadkey: string, callback?: (tile: Tile) => void): Tile | undefined; /** * Search for feature(s) in the provider. * * @param options - configure the search * * @example * ```typescript * // searching by id: * layer.search({id: 1058507462}) * // or: * layer.search({ids: [1058507462, 1058507464]}) * * // searching by point and radius: * layer.search({ * point: { longitude: 72.84205, latitude: 18.97172 }, * radius: 100 * }) * * // searching by Rect: * layer.search({ * rect: { minLon: 72.83584, maxLat: 18.97299, maxLon: 72.84443, minLat: 18.96876 } * }) * ``` * @returns array of features */ search(options: { /** * search feature by id. */ id?: number | string; /** * Array of feature ids to search. */ ids?: number[] | string[]; /** * Geographical center point of the point to search in. options.radius must be defined. */ point?: GeoPoint; /** * Radius of the point in meters, it is used in "point" search. */ radius?: number; /** * Geographical Rectangle to search in. [minLon, minLat, maxLon, maxLat] | GeoRect. */ rect?: GeoRect | GeoJSONBBox; }): Feature | Feature[]; /** * Point Search for feature(s) in provider. * @param point - Geographical center point of the point to search in. options.radius must be defined. * @param options - configure the search * * @example * ```typescript * layer.search({longitude: 72.84205, latitude: 18.97172},{ * radius: 100 * }) * // or: * layer.search([72.84205, 18.97172], { * radius: 100 * }) * ``` */ search(point: GeoPoint, options?: { /** * The radius of the circular area in meters to search in. */ radius: number; }): Feature[]; /** * Rectangle Search for feature(s) in provider. * @param rect - Geographical Rectangle to search in. [minLon, minLat, maxLon, maxLat] | GeoRect. * * @example * ``` * layer.search({minLon: 72.83584, maxLat: 18.97299, maxLon: 72.84443, minLat: 18.96876}) * // or: * layer.search([72.83584, 18.96876, 72.84443,18.97299]) * ``` */ search(rect: GeoRect | GeoJSONBBox): Feature[]; /** * Search for feature by id in the provider. * * @param id - id of the feature to search for * * @example * ``` * layer.search(1058507462) * ``` */ search(id: string | number): Feature; /** * Validate if a feature is stored in the local provider cache. * * @param feature - Object literal containing "id" property. * @returns the {@link Feature} if it is found, otherwise undefined */ exists(feature: { id: number | string; }): { feature?: Feature; }; /** * Modify coordinates of a feature in the provider. * * @param feature - the Feature whose coordinates should be modified/updated * @param coordinates - the modified coordinates to set. The coordinates must match features geometry type. */ setFeatureCoordinates(feature: Feature, coordinates: GeoJSONCoordinate | GeoJSONCoordinate[] | GeoJSONCoordinate[][] | GeoJSONCoordinate[][][]): void; /** * Remove feature(s) from the provider. * * @param feature - features that should be removed from the provider */ removeFeature(feature: GeoJSONFeature | Feature | GeoJSONFeatureCollection | GeoJSONFeature[]): any; /** * Finds the optimal path between two coordinates on a GeoJSON road network, considering various options. * By default, the weight function returns the distance of the road segment, a lower distance implies a shorter route and is considered more favorable. * If you have specific criteria such as road quality, traffic conditions, or other factors influencing the desirability of a road segment, you can customize the weight function accordingly. * Pathfinding will consider only the locally cached data available on the client. * * @experimental * * @param options - The options object containing parameters for finding the path. * @returns {Promise<{ * features: Feature[]; * readonly path: GeoJSONFeature; * readonly distance: number; * from: GeoJSONCoordinate; * to: GeoJSONCoordinate; * }>} A Promise that resolves to an object containing the path, additional information, and the distance of the path. * * @example * ```typescript * const pathOptions = { * from: [startLongitude, startLatitude], * to: [endLongitude, endLatitude], * // optional * allowTurn: (turn) => { * // Custom logic to determine whether a turn is allowed * return true; * }, * // optional * weight: (data) => { * // Custom weight function to determine the cost of traversing a road segment * return data.distance; // Default implementation uses distance as the weight * }, * }; * const result = await provider.findPath(pathOptions); * console.log(result); * ``` */ findPath(options: { /** * The starting coordinates defining the path. */ from: GeoJSONCoordinate | GeoPoint; /** * The ending coordinates of the path. */ to: GeoJSONCoordinate | GeoPoint; /** * Optional callback function to determine if a turn is allowed between road segments. * If not provided, all turns are considered allowed. * * @param {object} turn - Object containing information about the turn, including source and destination road segments. * @returns {boolean} `true` if the turn is allowed, `false` otherwise. */ allowTurn?: (turn: { /** * Object representing the source road segment of the turn. */ readonly from: { /** * GeoJSON Feature representing the source road segment. */ readonly link: Feature<'LineString'>; /** * Index of the Coordinates array of the source road segment. */ readonly index: number; }; /** * Object representing the destination road segment of the turn. */ readonly to: { /** * GeoJSON Feature representing the destination road segment. */ readonly link: Feature<'LineString'>; /** * Index of the Coordinates array of the destination road segment. */ readonly index: number; }; }) => boolean; /** * Optional callback function to determine the weight (cost) of traversing a road segment. * * @param {object} data - Object containing information about the road segment. * @returns {number} A numerical value representing the weight or cost of traversing the road segment. Default is the distance in meter. */ weight?: (data: { /** * Starting coordinates of the road segment. */ from: GeoJSONCoordinate; /** * Ending coordinates of the road segment. */ to: GeoJSONCoordinate; /** * Feature representing the road segment. */ feature: Feature<'LineString'>; /** * Direction of traversal on the road segment. */ direction: 'START_TO_END' | 'END_TO_START'; /** * The Distance of the road in meters. */ distance: number; }) => number; }): Promise<{ /** * A GeoJSON Feature of geometry type MultiLineString representing the geometry of the found path. */ readonly path: GeoJSONFeature<'MultiLineString'>; /** * An array of GeoJSON features representing the road segments in the path. */ features: Feature<'LineString'>[]; /** * the distance in meter of the path. */ readonly distance: number; /** * The starting coordinates of the path. */ from: GeoJSONCoordinate; /** * The end coordinates of the path. */ to: GeoJSONCoordinate; }>; } /** * Provides basic geocode and reverse geocode functionality that allows you to: * - Obtain geocoordinates for addresses * - Obtain addresses or administrative areas for locations * - Obtain geocoordinates for known landmarks * * Uses the HERE Geocoder API. * @see https://developer.here.com/documentation/geocoder/dev_guide/topics/what-is.html */ export declare class GeoCoder { /** * the url to the geocode service. */ private readonly url; /** * the url to the reverse geocode service. */ private readonly reverseUrl; /** * Current set config of the Geocoder. */ private cfg; /** * @param options - Options to configure the GeoCoder. */ constructor(options: GeoCoderOptions); /** * create the request url. * * @param baseUrl - the url to geocoder service (normal or reverse) * @param params - additional params for request url * @returns the request url */ private createUrl; /** * Reuquest the Geocoder Resource. * {@link https://developer.here.com/documentation/geocoder/dev_guide/topics/resource-geocode.html} * * @param params - additional parameters for geocode request * @param onSuccess - success callback * @param onError - error callback */ geocode(params: { [name: string]: string | string[] | number | number[]; }, onSuccess: (data: any) => void, onError?: (error: any) => void): void; /** * HTTPRequest the reverse Geocode Resource. * {@link https://developer.here.com/documentation/geocoder/dev_guide/topics/resource-reverse-geocode.html} * * @param params - additional parameters for reverse geocode request * @param onSuccess - success callback * @param onError - error callback */ reverseGeocode(params: { [name: string]: string | string[] | number | number[]; }, onSuccess: (data: any) => void, onError: (error: any) => void): void; /** * HTTPRequest reverse geocode request to receive ISO country code for a geographical position. * * @param position - it is either an array [longitude, latitude] or an object literal \{longitude: number, latitude: number\} * @param onSuccess - success callback which contains the iso country code. * @param onError - error callback */ getIsoCountryCode(position: number[] | GeoPoint, onSuccess: (isocc: string, data: any) => void, onError: (error: any) => void): void; } /** * Options to configure the GeoCoder. */ export declare interface GeoCoderOptions { /** * the app id required for authentication. * */ app_id: string; /** * the app code required for authentication. */ app_code: string; /** * The url to the Geocoder host. * * @defaultValue 'geocoder.api.here.com' */ host?: string; /** * the used Geocoder version. * * @defaultValue '6.2' */ version?: string; } /** * Defines a geographical rectangle. * The values of a GeoJSONBBox array are "[west: number, south: number, east: number, north: number]" */ export declare type GeoJSONBBox = [number, number, number, number]; /** * A GeoJSON Geometry coordinate is a array of coordinates. * The array must contain two or three elements [longitude, latitude, altitude?] / [x, y, z?]. */ export declare type GeoJSONCoordinate = number[]; /** * A GeoJSON Feature object. */ export declare interface GeoJSONFeature { /** * id of the feature. */ id?: string | number; /** * Type of GeoJSONFeature is 'Feature' */ type: 'Feature' | string; /** * The bounding box includes information on the coordinate range of the Feature. * The values of a bbox array are "[west: number, south: number, east: number, north: number]" */ bbox?: GeoJSONBBox; /** * The properties associated with the feature. */ properties?: { [name: string]: any; } | null; /** * A geometry is a object where the type member's value is one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon" or "MultiPolygon". * A geometry object must have a member with the name "coordinates". * The value of the coordinates member is always an array (referred to as the coordinates array below). * The structure for the elements in this array are determined by the type of geometry. * * For type "Point", each element in the coordinates array is a number representing the point coordinate in one dimension. * There must be at least two elements, and may be more. * The order of elements must follow x, y, z order (or longitude, latitude, altitude for coordinates in a geographic coordinate reference system). * * For type "MultiPoint", each element in the coordinates array is a coordinates array as described for type "Point". * * For type "LineString", each element in the coordinates array is a coordinates array as described for type "Point". * The coordinates array for a LineString must have two or more elements. * A LinearRing is a special case of type LineString where the first and last elements in the coordinates array are equivalent (they represent equivalent points). * Though a LinearRing is not explicitly represented as a geometry type, it is referred to in the Polygon geometry type definition. * * For type "MultiLineString", each element in the coordinates array is a coordinates array as described for type "LineString". * * For type "Polygon", each element in the coordinates array is a coordinates array as described for type "LineString". * Furthermore, each LineString in the coordinates array must be a LinearRing. * For Polygons with multiple LinearRings, the first must be the exterior ring and any others must be interior rings or holes. * * For type "MultiPolygon", each element in the coordinates array is a coordinates array as described for type "Polygon". * * * ``` * Point: * { * "type": "Point", * "coordinates": [100.0, 0.0] * } * * Polygon: * { * "type": "Polygon", * "coordinates": [ * [ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ] * ] * } *``` */ geometry: { type: 'Point' | 'MultiPoint' | 'LineString' | 'MultiLineString' | 'Polygon' | 'MultiPolygon' | GeometryType | string; coordinates: GeometryType extends 'Point' ? GeoJSONCoordinate : GeometryType extends 'MultiPoint' ? GeoJSONCoordinate[] : GeometryType extends 'LineString' ? GeoJSONCoordinate[] : GeometryType extends 'MultiLineString' ? GeoJSONCoordinate[][] : GeometryType extends 'Polygon' ? GeoJSONCoordinate[][] : GeometryType extends 'MultiPolygon' ? GeoJSONCoordinate[][][] : GeoJSONCoordinate | GeoJSONCoordinate[] | GeoJSONCoordinate[][] | GeoJSONCoordinate[][][]; }; } /** * A GeoJSONFeatureCollection is a collection of {@link GeoJSONFeature | GeoJSONFeatures}. */ export declare interface GeoJSONFeatureCollection { /** * The type of a GeoJSONFeatureCollection must be a string "FeatureCollection". */ type: 'FeatureCollection' | string; /** * An array of {@link GeoJSONFeature | GeoJSONFeatures}. */ features: GeoJSONFeature[]; } /** * GeoJSONProvider is a remote HTTPProvider designed to work with GeoJSON data. */ export declare class GeoJSONProvider extends HTTPProvider { /** * @param options - options to configure the provider */ constructor(options: HTTPProviderOptions); } /** * A GeoPoint represents a geographical point. */ export declare class GeoPoint { /** * the longitude in degrees */ longitude: number; /** * the latitude in degrees */ latitude: number; /** * the altitude in meters */ altitude?: number; /** * @param longitude - the longitude in degrees * @param latitude - the latitude in degrees * @param altitude - the altitude in degrees */ constructor(longitude: number, latitude: number, altitude?: number); } /** * A GeoRect represents a rectangular geographical area. * The area is defined by two longitudes (west, east) and two latitudes (north, south). */ export declare class GeoRect { /** * minimum longitude, the west-most longitude in degrees of the rectangular area */ minLon: number; /** * minimum latitude, the south-most latitude in degrees of the rectangular area */ minLat: number; /** * maximum longitude, the east-most longitude in degrees of the rectangular area */ maxLon: number; /** * maximum latitude, the north-most latitude in degrees of the rectangular area */ maxLat: number; /** * @param minLon - minimum longitude (west) * @param minLat - minimum latitude (south) * @param maxLon - maximum longitude (east) * @param maxLat - maximum latitude (north) */ constructor(minLon: number, minLat: number, maxLon: number, maxLat: number); } export declare function getProviderZoomOffset(tileSize: number): number; /** * Interface for configuring the visual appearance of Heatmaps. * Heatmaps are particularly good at showing the density of data within a specific area. */ export declare interface HeatmapStyle { /** * Specifies the type of style to render. */ type: 'Heatmap'; /** * Indicates the drawing order within a layer. * Styles with larger zIndex value are rendered above those with smaller values. * The zIndex is defined relative to the "zLayer" property. * If "zLayer" is defined all zIndex values are relative to the "zLayer" value. */ zIndex: number | StyleValueFunction | StyleZoomRange | StyleExpression; /** * Indicates drawing order across multiple layers. * Styles using zLayer with a high value are rendered on top of zLayers with a low value. * If no zLayer is defined, it will fall back to the {@link LayerStyle.zLayer} or depend on the display layer order. * The first (lowest) layer has a zLayer value of 1. * * @example \{...zLayer: 2, zIndex: 5\} will be rendered on top of \{...zLayer: 1, zIndex: 10\} */ zLayer?: number | StyleValueFunction | StyleExpression; /** * The radius in pixels with which to render a single point of the heatmap. * * @defaultValue 24 */ radius?: number | StyleValueFunction | StyleZoomRange | StyleExpression; /** * The fill color is a linear gradient used to colorize the heatmap. */ fill?: LinearGradient; /** * The heatmap weight defines how heavily a single data point is to be weighted and displayed within the heatmap. * The value used is equivalent to the number of actual points at that position. * The Weight is particularly useful for clustered data when combined with StyleValueFunction. * * @example * ```typescript * // the count property of a clustered point dataset defines how many points are located at the cluster position. * { type: "Heatmap", weight: (feature)=>feature.properties.count, fill: ... } * ``` * * @defaultValue 1 */ weight?: number | StyleValueFunction | StyleExpression; /** * The intensity of the Heatmap is a global multiplier on top of the weight. * The intensity is particularly useful for adapting the heatmap to the zoom-level of the map. * * @defaultValue 1 */ intensity?: number | StyleZoomRange | StyleExpression; /** * Defines the global opacity of the heatmap. * The value must be between 0.0 (fully transparent) and 1.0 (fully opaque). * * @defaultValue 1 */ opacity?: number | StyleValueFunction | StyleZoomRange | StyleExpression; } /** * The HTTPProvider fetches data from remote HTTP data-sources. */ export declare abstract class HTTPProvider extends EditableRemoteTileProvider { /** * @param options - options to configure the provider */ constructor(options: HTTPProviderOptions); /** * Get a specific request-header being added to all requests handled by the provider. * * @param name - The name of header to retrieve * * @returns value of the request header or null if the header does not exist */ getHeader(name: string): string | null; /** * Get the request-headers being added to all requests handled by the provider. * * @returns Map of key value pairs. the key represents the header name */ getHeaders(): { [name: string]: string; }; /** * Set request-header that should be added to all request handled by the provider. * * @param name - The name of the header whose value is to be set. * @param value - The value to set as the body of the header. */ setHeader(name: string, value: string): void; /** * Set request-headers that should be added to all request handled by the provider. * * @param map - Map of key value pairs. the key represents the header name. */ setHeaders(headers: { [name: string]: string; }): void; /** * Get the request-parameters that are being added by the provider to all requests. * * @returns Map of key value pairs. the key represents the parameter name. */ getParams(): { [name: string]: string; }; /** * Get a specific request-parameter that's being added by the provider to all requests. * * @param name - The name of parameter to retrieve * * @returns value of the request parameter or null if the parameter does not exist */ getParam(name: string): string | null; /** * Set request-parameters that should be added to all request handled by provider. * * @param map - A map of key value pairs. the key represents the parameter name. Possible value types are string, string[] or undefined. If undefined is used parameter get's cleared/removed. */ setParams(parameters: { [name: string]: string | string[] | undefined; }): void; /** * Set a specific request-parameter that should be added to all request handled by provider. * If undefined is set the parameter get's cleared/removed. * * @param name - The name of the parameter whose value is to be set. * @param value - The value(s) of the parameter. */ setParam(name: string, value: string | string[] | undefined): void; /** * Get or set configuration options for the provider. * * If a string is provided as the first argument, returns the value of the corresponding property. * If an object is provided, sets the provider's properties according to the object. * * @param options - The configuration key as a string to get a value, or an object to set multiple options. * @param value - Optional value to set if a string key is provided. */ config(options: HTTPProviderOptions | string, value?: any): TileProviderOptions; /** * Get URL feature specific requests. * * @param layer - the id of the layer * @param featureId - id of the feature the provider want's to request * * @returns url string to receive the feature resource of the remote http backend */ abstract getFeatureUrl(layer: string, featureId: string | number): string; /** * Get URL for layer specific requests. * * @param layer - the id of the layer * @returns url string to receive a layer resource of the remote http backend */ abstract getLayerUrl(layer: string): string; /** * Get URL for tile specific requests. * * @param layer - the id of the layer * @returns url string to receive a tile resource of the remote http backend */ abstract getTileUrl(layer: string): string; } /** * Options to configuration of HTTPProvider. */ export declare interface HTTPProviderOptions extends EditableRemoteTileProviderOptions { /** * URL for requesting tiles. * * It is either a string which may contain following flags that will be replaced by provider: * - \{SUBDOMAIN_CHAR\}: subdomain id(a, b, c and d) for balancing the load * - \{SUBDOMAIN_INT\}: subdomain id(0,1,2 and 3) for balancing the load * - \{SUBDOMAIN_INT_1_4\}: subdomain id(1,2,3 and 4) for balancing the load * - \{QUADKEY\}: quadkey of the tile to be requested * - \{Z\}: z of the tile to be requested * - \{X\}: x of the tile to be requested * - \{Y\}: y of the tile to be requested * * or a callback function that's called with the following parameters z,y,x,quadkey and needs to return the url for the respective tile. * The callback function needs to handle custom parameters by its own. * * @example * ``` * // string * url: 'https://xyz.api.here.com/hub/spaces/mySpace/tile/quadkey/{QUADKEY}?access_token=myAccessToken' * // callback function * url: (z, y, x, quadkey) => { * return 'https://xyz.api.here.com/hub/spaces/mySpace/tile/quadkey/' + quadkey + '?access_token=myAccessToken'; * } * ``` */ url?: string | ((z: number, y: number, x: number, quadkey: string) => string); /** * Indicates if requests are made with credentials. * * @defaultValue false */ withCredentials?: boolean; /** * Indicates if the requests should be made with https. * * @defaultValue true */ https?: boolean; /** * Set custom url service headers. * Custom headers will be applied to all request done by provider. */ headers?: { [header: string]: string; }; /** * Set custom url parameters. * Custom parameters will be applied to all request done by provider. */ params?: { [paramter: string]: string; }; } /** * Tile Provider for Image/Raster data. * eg: Satellite Tiles. */ export declare class ImageProvider extends TileProvider { /** * The opacity with which the image data should be displayed. */ private opacity; /** * @param options - options to configure the provider */ constructor(options: ImageProviderOptions); /** * Get a tile by quadkey. * * @param quadkey - quadkey of the tile * @param callback - the callback function * @returns the Tile is returned if its already cached locally */ getTile(quadkey: string, cb: (tile: Tile) => void): any; /** * Cancel ongoing request(s) and drop the tile. * * @param quadkey - the quadkey of the tile that should be canceled and removed. */ cancel(quadkey: string): void; /** * Cancel ongoing request(s) and drop the tile. * * @param tile - the tile that should be canceled and removed. */ cancel(tile: Tile): void; } /** * Options to configure the ImageProvider. */ declare interface ImageProviderOptions extends TileProviderOptions { /** * URL for requesting tiles. * * It is either a string which may contain following flags that will be replaced by provider: * - \{SUBDOMAIN_CHAR\}: subdomain id(a, b, c and d) for balancing the load * - \{SUBDOMAIN_INT\}: subdomain id(0,1,2 and 3) for balancing the load * - \{SUBDOMAIN_INT_1_4\}: subdomain id(1,2,3 and 4) for balancing the load * - \{QUADKEY\}: quadkey of the tile to be requested * - \{Z\}: z of the tile to be requested * - \{X\}: x of the tile to be requested * - \{Y\}: y of the tile to be requested * * or a callback function that's called with the following parameters z,y,x,quadkey and needs to return the url for the respective tile. * The callback function needs to handle custom parameters by its own. */ url: string | ((z: number, y: number, x: number, quadkey: string) => string); /** * An Image url or Image that will be displayed for errored tile requests. */ errorImage?: string | HTMLImageElement; /** * PreProcessor for remote data sources. * The PreProcessor will be executed just after data is being received from remote backend. * If the processor function is returning the processed data then its treated as a synchronous processor. * If the processor function does not return any value (undefined) or a Promise then its treated as asynchronous processor. * An asynchronous processor that's not using a Promise MUST call the input.ready(..) callback when data processing is finished. * * Due to the execution of the processor in a separate worker thread the processor function must be scope independent. * The processor must be a "standalone function/class" that only depends on its own scope and only accesses its own local variables. * No references to the outer scope of the processor function are allowed. * * @example * ``` * // PreProcessor: * ({data: any[], ready: (HTMLImageElement) => void, tile?:{x:number,y:number,z:number}) => HTMLImageElement | Promise * ``` */ preProcessor?(input: { data: any; ready: (data: HTMLImageElement) => void; tile?: { x: number; y: number; z: number; }; }): HTMLImageElement | Promise; } /** * Interface for configuring the visual appearance of Images/Icons. */ export declare interface ImageStyle { /** * Specifies the type of style to render. */ type: 'Image'; /** * Indicates the drawing order within a layer. * Styles with larger zIndex value are rendered above those with smaller values. * The zIndex is defined relative to the "zLayer" property. * If "zLayer" is defined all zIndex values are relative to the "zLayer" value. */ zIndex: number | StyleValueFunction | StyleZoomRange | StyleExpression; /** * Indicates drawing order across multiple layers. * Styles using zLayer with a high value are rendered on top of zLayers with a low value. * If no zLayer is defined, it will fall back to the {@link LayerStyle.zLayer} or depend on the display layer order. * The first (lowest) layer has a zLayer value of 1. * * @example \{...zLayer: 2, zIndex: 5\} will be rendered on top of \{...zLayer: 1, zIndex: 10\} */ zLayer?: number | StyleValueFunction | StyleExpression; /** * Specifies the URL of the image to render. * It can be either absolute or relative path. */ src: string | StyleValueFunction | StyleZoomRange | StyleExpression; /** * If specified, the Image provided by {@link src} is considered as an IconAtlas/TextureAtlas. * The clipping region for the image must be defined by x, y, width and height. * The maximum supported atlas size is 4096x4096. */ atlas?: { x: number; y: number; width: number; height: number; }; /** * Defines the opacity of the style. * The value must be between 0.0 (fully transparent) and 1.0 (fully opaque). * It is valid for all style types. * @defaultValue 1 */ opacity?: number | StyleValueFunction | StyleZoomRange | StyleExpression; /** * Width of the Image in pixels. * The maximum supported width for "Image" is 64 pixels. * The unit of width is defined in pixels. * @example * ```typescript * // define an Image that has a width (and height) of 64 pxiels * { * zIndex: 0, * type: "Image", * src: "urlToImage.png", * width: 64 * } * ``` */ width: number | StyleValueFunction | StyleZoomRange | StyleExpression; /** * Height of the Image in pixels. * The maximum supported height for "Image" is 64 pixels. * The unit of width is defined in pixels. * If the height is not explicitly defined, the value of the width is used as the height. * * @example * ```typescript * // define an Image that has a width of 32 and height of 64 pxiels * { * zIndex: 0, * type: "Image", * src: "urlToImage.png", * width: 32, * height: 64 * } * ``` */ height?: number | StyleValueFunction | StyleZoomRange | StyleExpression; /** * Offset the shape in pixels on x-axis. * A positive value offsets to the right, a negative value to the left. * The default unit is pixels. * * @example * ```typescript * // offset Image by 8px to the right. * { type: "Image", zIndex: 0, src: '...', offsetX: 8} * * ``` */ offsetX?: number | string | StyleValueFunction | StyleZoomRange | StyleExpression; /** * Offset the shape in pixels on y-axis. * A positive value offsetY offsets downwards, a negative value upwards. * The default unit is pixels. * * @example * ```typescript * // offset Image by 8px to the bottom * { type: "Image", zIndex: 0, src: '...', offsetY: 8} * ``` */ offsetY?: number | StyleValueFunction | StyleZoomRange | StyleExpression; /** * Offset the shape in pixels on z-axis. * A positive value offsets up, a negative value down. * The default unit is pixels. * * @example * ```typescript * // offset Image by 8px to the top. * { type: "Image", zIndex: 0, src: '...', offsetZ: 8} * ``` */ offsetZ?: number | string | StyleValueFunction | StyleZoomRange | StyleExpression; /** * Alignment for styles of type "Circle". * Possible values are: "map" and "viewport". * "map" aligns to the plane of the map and "viewport" aligns to the plane of the viewport/screen. * Default alignment for Text based on point geometries is "viewport" while "map" is the default for line geometries. */ alignment?: 'map' | 'viewport' | StyleValueFunction | StyleZoomRange | StyleExpression; /** * Rotate the shape of the style to the angle in degrees. */ rotation?: number | StyleValueFunction | StyleZoomRange | StyleExpression; /** * In case of label collision, Text with a higher priority (lower value) will be drawn before lower priorities (higher value). * If the collision detection is enabled for multiple Styles within the same StyleGroup, the highest priority (lowest value) * is used. */ priority?: number | StyleValueFunction | StyleZoomRange | StyleExpression; /** * Minimum distance in pixels between repeated style-groups on line geometries. * Applies per tile only. * * @defaultValue 256 (pixels) */ repeat?: number | StyleValueFunction | StyleZoomRange | StyleExpression; /** * Sets the anchor point for styles of type "Image" used with Line or Polygon geometry. * * Possible values for Line geometry are "Coordinate" and "Line". * - "Coordinate": the respective style is displayed at each coordinate of the polyline. * - "Line": the respective style is displayed on the shape of the polyline when there is enough space. See {@link checkLineSpace} to disable the space check. * * Possible values for Polygon geometry are "Center" and "Centroid". * - "Center": the center of the bounding box of the polygon. * - "Centroid": the geometric centroid of the polygon geometry. * * @defaultValue For Polygon geometry the default is "Center". For Line geometry the default is "Line". */ anchor?: 'Line' | 'Coordinate' | 'Centroid' | StyleValueFunction | StyleZoomRange | StyleExpression; /** * Enable or disable the space check for point styles on line geometries. * If check checkLineSpace is enabled the respective style is only displayed if there is enough space on the line, * otherwise it is not displayed. * * @defaultValue true */ checkLineSpace?: boolean | StyleValueFunction | StyleZoomRange | StyleExpression; /** * Enable or disable collision detection. * If the collision detection is enabled for multiple Styles within the same StyleGroup, the respective Styles are * handled as a single Object ("CollisionGroup") where the combined bounding-box is determined automatically. * * - true: collision are allowed, Collision detection is disabled. * - false: avoid collisions, Collision detection is enabled. * * @defaultValue false for "Text", true for all other. */ collide?: boolean | StyleValueFunction | StyleZoomRange | StyleExpression; /** * Enables collision detection and combines all styles of a StyleGroup with the same "CollisionGroup" into a single logical object for collision detection. */ collisionGroup?: string | StyleValueFunction | StyleZoomRange | StyleExpression; /** * Altitude of the Image center in meters. * * Describes the vertical distance from the global ground plane (0m) to the Image. * * Supported values: * - false (default): place at 0m. * - true: use the altitude (z) from the feature geometry if present, else 0. Not re-aligned to the rendered terrain. * If the geometry altitude source differs from the TerrainTileLayer source/resolution, the Image can appear * slightly above or below the visible terrain surface. * - number: fixed absolute altitude in meters. Also not adjusted when terrain tiles load; may not perfectly sit * on the terrain unless both use exactly the same elevation source, datum and resolution. * - 'terrain': sample (clamp to) the current terrain surface height. While the terrain tile is not yet loaded * (or no terrain layer exists) the altitude is 0 and updates once data becomes available. * * Notes: * - Use 'terrain' to keep the Image visually seated on the rendered terrain. * - Use a numeric value for a constant absolute elevation independent of terrain updates. * - To position something N meters above terrain: use 'terrain' plus offsetZ (e.g. offsetZ: '5m'). * - Expect mismatches (floating / sinking) when using true or a fixed number with a different terrain data source. * * @defaultValue false * @experimental */ altitude?: number | boolean | 'terrain' | StyleValueFunction | StyleZoomRange | StyleExpression; /** * Scales the size of a style based on the feature's altitude. * If it's enabled (true), features closer to the camera will be drawn larger than those farther away. * When off (false), the size of the style is always the same size, regardless of its actual altitude, as if it were placed on the ground (altitude 0). * This attribute applies to styles of type "Rect", "Image", "Text", "Circle", "Line", "Box", or "Sphere" whose size ({@link width}, {@link radius}, {@link strokeWidth}) that are using "map" {@link alignment} only. * If the size attribute is defined in meters, scaleByAltitude is enabled by default, for pixels it is disabled. * * @defaultValue false (pixels), true (meters) * * @experimental */ scaleByAltitude?: boolean | StyleValueFunction | StyleZoomRange | StyleExpression; } /** * An IMLProvider is a remote HTTPProvider designed to work with HERE Interactive Map layer. * @see https://developer.here.com/documentation/data-api/data_dev_guide/rest/getting-data-interactive.html * @see https://interactive.data.api.platform.here.com/openapi/ */ export declare class IMLProvider extends SpaceProvider { /** * @param options - options to configure the provider * @example * ```ts * const provider = new IMLProvider({ * level: 10, * layer: 'boston-liquor', * catalog: 'hrn:here:data::olp-here:dh-showcase', * credentials: { * apiKey: "YOUR_API_KEY", * } * }); * ``` */ constructor(options: IMLProviderOptions); /** * Get or set configuration options for the provider. * * If a string is provided as the first argument, returns the value of the corresponding property. * If an object is provided, sets the provider's properties according to the object. * * @param options - The configuration key as a string to get a value, or an object to set multiple options. * @param value - Optional value to set if a string key is provided. */ config(options: IMLProviderOptions | string, value?: any): TileProviderOptions; } /** * Options to configure the IMLProvider. */ export declare interface IMLProviderOptions extends HTTPProviderOptions { /** * Name of the Interactive Map Layer. */ layer: string; /** * Name of the catalog of the Interactive Map Layer. */ catalog: string; /** * User credential of the provider */ credentials: { /** * apiKey for read access */ apiKey: string; /** * token for write access */ token?: string; }; /** * Indicates the tag(s) that should be set in the requests. * * @defaultValue false */ tags?: false | string | string[]; /** * Indicates if result geometry of tile requests should be clipped. * * @defaultValue false */ clip?: boolean; /** * URL of the Interactive Map Layer endpoint. * * @defaultValue "https://interactive.data.api.platform.here.com/interactive/v1" */ url?: string; /** * define property search query to enable remote filtering by property search. * * @see https://interactive.data.api.platform.here.com/openapi/#/Read%20Features * * @defaultValue null */ propertySearch?: { [name: string]: { operator: '=' | '!=' | '>' | '>=' | '<' | '<='; value: any | any[]; }; }; } /** * TileLayer */ export declare class Layer { /** * The name of the Layer */ name: string; /** * The identifier of the Layer. */ readonly id: string; /** * minimum zoom level at which data from the Layer is displayed. */ min: number; /** * maximum zoom level at which data from the Layer will be displayed. */ max: number; /** * @param options - options to configure the Layer */ constructor(options: LayerOptions); /** * Sets the visibility of the Layer. * * This function controls whether the tile layer is currently displayed or hidden. * * @param {boolean} [isVisible] - A boolean value indicating whether the tile layer should be visible (true) or hidden (false). * * @returns {boolean} - The current visibility state of the tile layer. * * @example * ``` * // Create a new tile layer * let tileLayer = new XYZMapsTileLayer(); * * // Hide the tile layer * tileLayer.visible(false); * * // Show the tile layer * tileLayer.visible(true); * ``` */ setVisible(isVisible?: boolean): void; /** * Checks whether the xyz-maps tile layer is currently visible. * * @returns {boolean} - Returns `true` if the layer is visible, otherwise `false`. * * @example * ``` * if (layer.isVisible()) { * console.log("Layer is visible"); * } else { * console.log("Layer is not visible"); * } * ``` */ isVisible(): boolean; } /** * Configuration options for a Layer. */ declare interface LayerOptions { /** * Name of the Layer. */ name?: string; /** * minimum zoom level at which data from the Layer will be displayed. */ min?: number; /** * maximum zoom level at which data from the Layer will be displayed. */ max?: number; /** * Indicates whether the layer should be visible (`true`) or hidden (`false`). * @defaultValue true */ visible?: boolean; levelOffset?: number; tiled?: boolean; } /** * This is an interface to describe how certain features should be rendered within a layer. * @example * ```typescript * { * styleGroups: { * "myLineStyle": [ * {zIndex: 0, type: "Line", opacity: 1, stroke: "#BE6B65", strokeWidth: 16}, * {zIndex: 1, type: "Line", opacity: 1, stroke: "#E6A08C", strokeWidth: 12}, * {zIndex: 2, type: "Text", fill: "#000000", "textRef": "properties.name"} * ] * }, * assign: function(feature: Feature, zoomlevel: number){ * return "myLineStyle"; * } * } * ``` */ export declare interface LayerStyle { /** * Option LayerStyle definitions that can be references and reused by {@link Style|Styles} within the Layer. */ definitions?: { [definitionName: string]: boolean | number | StyleExpression | any[] | null; }; /** * @deprecated define strokeWidth style property using a "StyleZoomRange" value instead. * @hidden */ strokeWidthZoomScale?: (level: number) => number; /** * Specifies the background color of the layer. * * This property can accept different types of values to determine the background color: * - A fixed `Color`. * - A `StyleZoomRange` object to define color based on zoom levels. * - A function `(zoomlevel: number) => Color` to compute the color dynamically based on the zoom level. * - A `StyleExpression` to compute the color using a style expression. */ backgroundColor?: Color | StyleZoomRange | ((zoomlevel: number) => Color) | StyleExpression; /** * Defines the sky color of the map. * - The sky becomes visible when the map is pitched to higher angles. * - When multiple layers with different sky colors are used, the sky color from the bottommost layer is applied. * - Supports various formats, including: * - `Color`: A single color applied across all zoom levels. * - `StyleZoomRange`: Specifies a range of colors based on zoom levels. * - `(zoomlevel: number) => Color`: A function that dynamically determines the color based on the current zoom level. * - `StyleExpression`: An expression to compute color based on style parameters. * - `LinearGradient`: Applies a gradient effect for smooth transitions in sky color. * - When using `LinearGradient`, stops at `0` represent the color near the horizon (close to the ground), and stops at `1` represent the color in the sky at the top of the screen. * - The full gradient (0 to 1) becomes fully visible only when the map pitch is set to maximum (85 degrees). */ skyColor?: Color | StyleZoomRange | ((zoomlevel: number) => Color) | StyleExpression | LinearGradient; /** * The `lights` property specifies a collection of light sources that can be used to illuminate features within the layer. * It is a map where each key is a unique light group name, and the value is an array of light objects. * Lights can be of various types, including {@link AmbientLight} and {@link DirectionalLight}, and can be used to create different lighting effects. * * The `lights` property allows you to define and organize multiple light sources that influence the rendering of features in the layer. * * ### Structure * - **Key (string):** A unique identifier for the light group. * - **Value (array):** An array of light objects, which can be of type {@link AmbientLight} or {@link DirectionalLight}. * * ### Relation to Style.light * - **{@link Style.light}**: Specifies which single light group to use for illuminating a specific feature. This property must reference a key defined in `LayerStyle.lights`. * - **Default Light**: If a `FeatureStyle` does not specify a `light`, the light group associated with the `"defaultLight"` key in `LayerStyle.lights` will be used. If `"defaultLight"` is not defined, a default light will be automatically provided. * - **Only One Light Group**: Only one light group is used to illuminate a feature. This is either the group specified in `FeatureStyle.light`, or if not specified, the `"defaultLight"` group from `LayerStyle.lights`. * - **Override Default Light**: To override the default light, set it explicitly in `LayerStyle.lights` under the key `"defaultLight"`. * * ### Examples * ```typescript * { * lights: { * // Define a light group named "default" to override the default lighting for the layer * "defaultLight": [{ * type: 'ambient', * color: '#fff', * intensity: 0.3 * }, { * type: 'directional', * color: '#fff', * direction: [0, 0, 1], * intensity: 1.0 * }, { * type: 'directional', * color: '#fff', * direction: [-1, 0, 0], * intensity: 0.2 * }], * // Define a light group named "buildingLights" for specific features * "buildingLights": [ * { type: "ambient", color: "#fff", intensity: 1.0 } // A simple ambient light source for buildings * ] * } * } * ``` * * In the example above: * - `"defaultLight"` is a light group that overrides the standard lighting configuration. It includes both an ambient and a directional light source and is used for all illuminated FeatureStyle instances where the light property is not explicitly set. * - `"buildingLights"` is a light group containing only an ambient light source. This group will only be used for features where {@link Style.light} is set to `"buildingLights"`. * - Each light source can be customized with properties such as `color`, `intensity`, and, for `DirectionalLight`, a `direction` vector. * * The lights specified here will be applied to the rendering of features within the layer. However, only one light group will be used for each feature: * - If {@link Style.light} is defined, it will reference a specific light group in `LayerStyle.lights`. * - If {@link Style.light} is not defined, the `"defaultLight"` light group (if specified) will be used. * - If no `"defaultLight"` light group is set, an automatic default light will be provided. * * @type { { [name: string]: (AmbientLight | DirectionalLight)[] } } */ lights?: { [name: string]: (AmbientLight | DirectionalLight)[]; }; /** * This object contains key/styleGroup pairs. * A styleGroup is an array of {@link Style}, that exactly defines how a feature should be rendered. */ styleGroups: { [key: string]: Array