import { EventEmitter } from '../../stencil-public-runtime'; import { Popup, type EaseToOptions, type ErrorEvent, type LngLatBoundsLike, type LngLatLike, type MapGeoJSONFeature, type MapLibreMap, type MapMouseEvent, type MapSourceDataEvent, type Point } from 'maplibre-gl'; import '@awesome.me/webawesome/dist/components/callout/callout.js'; import { type PreviewError } from '../../lib/errors'; import GlobeControl from '../../lib/globe-control'; import { type PixelWindow } from '../../lib/geometry'; import { type LayerControl, type LayerState } from '../../lib/layers'; import LayersControl from '../../lib/layers-control'; import type MapPreviewer from '../../lib/previewers/map'; import type { References } from '../../lib/references'; import MapLibreTheme from '../../lib/themes/maplibre'; export declare class OgmMap { el: HTMLElement; previewer: MapPreviewer; theme: 'light' | 'dark'; darkBasemap?: string; lightBasemap?: string; padding: number; /** * Whether a wheel needs the command key, and a touch drag needs a second finger, before either * reaches the map - see MapLibre's CooperativeGesturesHandler. On by default, since a small map * embedded in a page must not eat the scroll a reader meant for the page around it. A page that * gives the map the whole screen, or has its own way of keeping the two apart, can turn it off. */ cooperativeGestures: boolean; references?: References; mapIdle: EventEmitter; mapLoading: EventEmitter; previewError: EventEmitter; layerControls: LayerControl[]; layersPanelOpen: boolean; notice?: string; basemapNotice?: string; failedBasemap?: string; protected layersControl: LayersControl; private layerState; protected globeControl: GlobeControl; private mapStyleLoaded; private basemapFellBack; private errorReported; private loadDeadline; private previewDrawn; private tilesLoading; private previewSettled; private settlePreview; protected map: MapLibreMap; protected mapTheme: MapLibreTheme; protected popup: Popup | undefined; protected popupResize: ResizeObserver | undefined; protected attributesEl: HTMLOgmAttributesElement; protected hoveredFeature: MapGeoJSONFeature | undefined; protected selectedFeature: MapGeoJSONFeature | undefined; componentWillLoad(): void; componentDidLoad(): Promise; disconnectedCallback(): void; protected getContainer(): HTMLElement; protected addControls(): void; onPreviewerChange(_previewer: MapPreviewer, previous?: MapPreviewer): Promise; loadPreview(): Promise; onThemeChange(): Promise; onCooperativeGesturesChange(): void; protected handleMapError(event: ErrorEvent & { sourceId?: string; }): void; protected confirmBasemapFailure(): void; /** * Draw on an empty basemap, for a map whose real one never arrived. * * Everything downstream of a style document waits on the style.load a failed one never fires: * mapStyleLoaded, and so loadPreview, and so every source a preview adds. So a basemap CDN having * a bad day didn't just cost the backdrop, it abandoned the preview - no spinner, no alert, and not * one request made for the data the reader came for. It also can't be waited out, because there is * no second attempt: MapLibre asks for a style document once. * * Handing over a style document of our own puts all of that back: MapLibre fires style.load for it * like any other, which lets go of loadPreview, and its own `load` follows from the next frame * since that latch was never set. The theme swap does the same thing through setBasemap, which * waits on the same event. * * The basemap is the backdrop and the data is the point, so losing the first is not a reason to * give up on the second - but it is a reason to say so, which the notice does. */ protected fallBackToEmptyBasemap(): void; protected handleSourceData(event: MapSourceDataEvent): void; protected handleSourceDataLoading(event: MapSourceDataEvent): void; private settleTileLoading; private markPreviewDrawn; protected startLoadDeadline(): void; private clearLoadDeadline; private reportError; protected applyViewConstraints(): void; fitMapBounds(bounds: LngLatBoundsLike): Promise; onPaddingChange(): Promise; easeMapTo(options: EaseToOptions): Promise; handleLayerVisibilityChange(event: CustomEvent<{ id: string; visible: boolean; }>): void; handleLayerOpacityChange(event: CustomEvent<{ id: string; opacity: number; }>): void; handleLayerColorRampChange(event: CustomEvent<{ id: string; colorRamp: LayerState['colorRamp']; }>): void; handleLayerBackgroundRemovalChange(event: CustomEvent<{ id: string; removeBackground: boolean; }>): void; handleAllLayersVisibilityChange(event: CustomEvent): void; protected toggleLayersPanel(): void; private setLayerState; private recordLayerState; private commitLayerState; private applyLayerState; private setupLayerControls; protected handleHover(event: MapMouseEvent): void; protected handleClick(event: MapMouseEvent): Promise; protected handleInspection(point: Point): Promise; protected queryWindow(point: Point): PixelWindow; handleFeatureSelected(event: CustomEvent): void; protected clearFeatureSelection(): void; protected selectFeature(feature: MapGeoJSONFeature): void; protected hoverFeature(feature: MapGeoJSONFeature): void; protected clearHoveredFeature(): void; private setFeatureState; protected createPopup(location: LngLatLike): void; protected destroyPopup(): void; protected get queryableLayerIds(): string[]; render(): any; }