import { ExtendedStatusType } from '@siemens/element-ng/common'; import * as _angular_core from '@angular/core'; import { Signal, TemplateRef } from '@angular/core'; import { StyleSpecification } from 'maplibre-gl'; import * as geojson from 'geojson'; import * as _siemens_element_translate_ng_translate from '@siemens/element-translate-ng/translate'; /** * Copyright (c) Siemens 2016 - 2026 * SPDX-License-Identifier: MIT */ /** A point feature consumed by the clustered MapLibre source. */ type ClusterPoint = GeoJSON.Feature; /** * Built-in group palette or exact colors indexed by positive group ID. The `'status'` palette is * the four-color palette used for numeric groups; it is separate from status-based bucketing. */ type ClusterColors = 'status' | 'element' | Record; /** A rendered color segment and its generated cluster-property name. */ interface ClusterSegment { color: string; property: string; } /** * Context supplied to custom cluster popover templates, including all locations loaded so far. * * @experimental */ interface ClusterPopoverContext { /** All loaded original point features, exposed by an unqualified `let-features` binding. */ $implicit: readonly ClusterPoint[]; /** The same accumulated features as `$implicit`, exposed by `let-features="features"`. */ features: readonly ClusterPoint[]; /** Total number of locations in the selected cluster, including locations not yet loaded. */ total: number; /** Whether the initial batch, an additional batch, or a retry is being loaded. */ loading: boolean; /** Error from a failed batch request, or `undefined` when no error is available. */ error: unknown; /** Selected cluster feature, including its `cluster_id` and `point_count` properties. */ cluster: ClusterPoint; /** Closes the popover using the same behavior as its Close button. */ close: () => void; } /** * Copyright (c) Siemens 2016 - 2026 * SPDX-License-Identifier: MIT */ /** Status values supported by status markers and cluster status segments. */ type MarkerStatus = ExtendedStatusType | 'default'; /** * Copyright (c) Siemens 2016 - 2026 * SPDX-License-Identifier: MIT */ /** * Creates a signal that returns a {@link StyleSpecification} for MapLibre GL based on the current * Element theme. The signal automatically updates when the theme switches between light and dark. * * @remarks * **Must be called in an Angular injection context** (e.g. inside a constructor, field initializer, * or a function called from one). Calling this function outside of an injection context will throw * an `assertInInjectionContext` error. * * @experimental * * @param key - The MapTiler API key used to fetch tiles, glyphs, and sprites * @returns A signal that provides the current {@link StyleSpecification} based on the active theme * @throws When called outside of an Angular injection context */ declare const injectSiMapStyle: (key: string) => Signal; /** * Copyright (c) Siemens 2016 - 2026 * SPDX-License-Identifier: MIT */ type ClusterProperties = Record; /** @internal */ interface ClusterConfiguration { clusterProperties: ClusterProperties; segments: readonly ClusterSegment[]; } /** * Adds a clustered GeoJSON source to a MapLibre map and renders interactive cluster markers. * * Cluster markers display the number of contained points and their distribution by group. Status * segments can be enabled for ungrouped points by providing `statusProperty`. Render individual, * unclustered points separately with `mgl-markers-for-clusters` using the same source ID. * Positive numeric groups always take precedence over status segments. Status segments apply only * when the normalized group value is zero; points without a matching group or status use the * ungrouped color. * * Clicking a cluster frames all of its children and zooms in as far as possible while they stay * visible, up to the zoom at which points stop being clustered. Clusters whose children stay * within `clusterRadius` until then emit `clusterClick` instead, which opens a projected * `si-cluster-popover`. * * @example Basic usage * ```html * * * * * * * * * * ``` * * @experimental */ declare class SiClusterSourceComponent { private readonly mapService; private readonly document; private readonly destroyRef; private readonly injector; /** ID used to register the generated GeoJSON source in MapLibre. */ readonly sourceId: _angular_core.InputSignal; /** * Point feature collection to cluster. * @defaultValue EMPTY_DATA */ readonly data: _angular_core.InputSignal>; /** * Feature property containing the positive numeric group ID. * @defaultValue 'group' */ readonly groupProperty: _angular_core.InputSignal; /** * Built-in palette or exact colors indexed by group ID. The built-in `'status'` palette contains * four colors for numeric groups and is separate from status-based bucketing. * @defaultValue 'status' */ readonly groupColors: _angular_core.InputSignal; /** * Top-level feature property containing a {@link MarkerStatus} value. Status bucketing is * disabled by default and only applies when the normalized group value is zero. Missing or * unsupported status values, and groups that do not match a configured bucket, use the ungrouped * color. Built-in colors match `SiStatusMarkerComponent`, with `default` using accent and * `unknown` using neutral. * @defaultValue undefined * @see https://maplibre.org/maplibre-style-spec/sources/#clusterproperties */ readonly statusProperty: _angular_core.InputSignal; /** * Cluster radius in pixels. * @defaultValue 50 */ readonly clusterRadius: _angular_core.InputSignal; /** * Maximum zoom at which points are clustered. * @defaultValue undefined */ readonly clusterMaxZoom: _angular_core.InputSignal; /** * Minimum number of points required to form a cluster. * @defaultValue 2 */ readonly clusterMinPoints: _angular_core.InputSignal; /** * Frames the children of a clicked cluster and zooms in as far as possible while they stay * visible. Clusters whose children cannot be pulled apart emit `clusterClick` instead. * @defaultValue false */ readonly zoomOnClick: _angular_core.InputSignalWithTransform; /** * Highest zoom used to expand a cluster. Clusters whose children stay within `clusterRadius` * up to this zoom emit `clusterClick` instead of zooming. Defaults to `clusterMaxZoom`, * because points stop being clustered above it. * @defaultValue undefined */ readonly zoomMaxLevel: _angular_core.InputSignal; /** * Emits when a cluster marker is activated and the click did not expand the cluster, either * because `zoomOnClick` is disabled or because the children cannot be pulled apart. */ readonly clusterClick: _angular_core.OutputEmitterRef; protected readonly clusterConfiguration: _angular_core.Signal; /** Stores selection for the projected cluster-popover integration. */ protected readonly selectedCluster: _angular_core.WritableSignal; private readonly source; private clickToken; /** * Returns a page of original points belonging to a cluster. * @see https://maplibre.org/maplibre-gl-js/docs/API/classes/GeoJSONSource/#getclusterleaves */ getClusterLeaves(clusterId: number, limit: number, offset: number): Promise; protected onClusterClick(cluster: ClusterPoint): Promise; /** Descends into clusters that do not split yet, so a click never zooms without an effect. */ private getSeparableChildren; private getClusterChildren; /** * Returns the camera that reveals the children, or `undefined` when zooming cannot reveal them. * The children are framed instead of the cluster, whose coordinates are the weighted centroid * quantized to the tile grid and would push outlying children out of the viewport. */ private getExpansionCamera; private zoomToChildren; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } /** * Optional popup with incrementally loaded locations projected into a `si-cluster-source`. * * @experimental */ declare class SiClusterPopoverComponent { private static idCounter; private readonly destroyRef; private readonly focusTrapFactory; private readonly document; private readonly source; private readonly mapService; private readonly resizeObserver; /** * Maximum width passed to the MapLibre popup. * @defaultValue '320px' */ readonly maxWidth: _angular_core.InputSignal; /** * Whether the popup closes when the map moves. * @defaultValue true */ readonly closeOnMove: _angular_core.InputSignalWithTransform; /** * Number of locations loaded initially and with each "Load more" action. * @defaultValue 8 */ readonly pageSize: _angular_core.InputSignalWithTransform; /** * Feature property displayed in the default list. * @defaultValue 'name' */ readonly labelProperty: _angular_core.InputSignal; /** * Feature property displayed as the description in the default list. * @defaultValue 'description' */ readonly descriptionProperty: _angular_core.InputSignal; private readonly dialog; private readonly scrollRegion; private readonly batchButton; private readonly selectedCluster; private readonly batchFocusRequested; private readonly offset; private readonly displayedFeatures; protected readonly titleId: string; protected readonly popupCoordinates: _angular_core.WritableSignal; protected readonly availableBlockSize: _angular_core.WritableSignal; protected readonly leaves: _angular_core.ResourceRef; protected readonly context: _angular_core.Signal; protected readonly template: _angular_core.Signal | undefined>; protected readonly clusterPopoverTitle: _siemens_element_translate_ng_translate.TranslatableString; protected readonly locationsLabel: _siemens_element_translate_ng_translate.TranslatableString; protected readonly errorText: _siemens_element_translate_ng_translate.TranslatableString; protected readonly loadMoreText: _siemens_element_translate_ng_translate.TranslatableString; protected readonly retryText: _siemens_element_translate_ng_translate.TranslatableString; protected readonly closeText: _siemens_element_translate_ng_translate.TranslatableString; protected readonly icons: Record<"elementCancel", string>; protected readonly close: () => void; protected readonly loadBatch: () => void; constructor(); static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } /** * Template for custom location content inside `si-cluster-popover`. * * Receives a {@link ClusterPopoverContext} with all locations loaded so far. Loading feedback, * error recovery, and the "Load more" button are handled by the popover. * * @experimental */ declare class SiClusterPopoverTemplateDirective { /** @internal */ static ngTemplateContextGuard(directive: SiClusterPopoverTemplateDirective, context: unknown): context is ClusterPopoverContext; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } /** * Copyright (c) Siemens 2016 - 2026 * SPDX-License-Identifier: MIT */ /** * Provides translated MapLibre locale strings as an Angular signal. The record uses MapLibre's * original locale keys, such as `AttributionControl.ToggleAttribution`, and updates when the * active Element language changes. * * @example * ```ts * @Component({ ... }) * export class MapComponent { * protected readonly mapTranslations = injectSiMapTranslations(); * } * ``` * * ```html * * ``` * * @returns A signal containing a MapLibre locale record, for example * `{ 'AttributionControl.ToggleAttribution': 'Toggle attribution' }`. */ declare const injectSiMapTranslations: () => Signal>; declare class SiStatusMarkerComponent { /** * The status of the marker. * @defaultValue 'default' */ readonly status: _angular_core.InputSignal; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } export { SiClusterPopoverComponent, SiClusterPopoverTemplateDirective, SiClusterSourceComponent, SiStatusMarkerComponent, injectSiMapStyle, injectSiMapTranslations }; export type { ClusterColors, ClusterPoint, ClusterPopoverContext, ClusterSegment, MarkerStatus };