import * as i0 from '@angular/core'; import { InputSignal, OutputRef, Signal, ElementRef, ResourceRef, Provider, EnvironmentProviders } from '@angular/core'; import OLMap from 'ol/Map'; import { View, Feature as Feature$1 } from 'ol'; type Coordinate = [number, number]; type Extent = [number, number, number, number]; type Pixel = [number, number]; type FeatureId = string; interface Feature { id: FeatureId; geometry: Geometry; properties?: Record; style?: Style; } type GeometryType = 'Point' | 'LineString' | 'Polygon' | 'Circle' | 'Ellipse' | 'Sector'; interface Geometry { type: GeometryType; coordinates: Coordinate | Coordinate[] | Coordinate[][]; } interface Style { fill?: { color?: string; }; stroke?: { color?: string; width?: number; }; image?: { radius?: number; fill?: { color?: string; }; stroke?: { color?: string; width?: number; }; }; /** * Icon style for Point features. When set, renderers should produce an * `ol/style/Icon` with the given source. Used by the military symbology * helpers to embed `milsymbol`-generated SVGs as data URLs. */ icon?: { /** Image source — typically a `data:image/svg+xml;base64,...` URL */ src: string; /** Pixel size `[width, height]` */ size?: [number, number]; /** * Anchor in fractional coordinates `[x, y]` where `0..1` is the icon * extent. `[0.5, 0.5]` centers the icon on the feature. */ anchor?: [number, number]; }; text?: { text?: string; font?: string; fill?: { color?: string; }; stroke?: { color?: string; width?: number; }; }; } interface Layer { id: string; visible?: boolean; opacity?: number; zIndex?: number; } interface ViewState { center: Coordinate; zoom: number; rotation?: number; } type ProjectionCode = 'EPSG:4326' | 'EPSG:3857' | string; interface MapConfig { target?: string | HTMLElement; view?: Partial; projection?: ProjectionCode; } interface MapClickEvent { coordinate: Coordinate; pixel: Pixel; } declare class OlMapComponent { private mapService; private zoneHelper; private destroyRef; center: InputSignal; zoom: InputSignal; rotation: InputSignal; projection: InputSignal; coordinateProjection: InputSignal; private readonly viewChange$; readonly viewChange: OutputRef; private readonly mapClick$; readonly mapClick: OutputRef; private readonly mapDblClick$; readonly mapDblClick: OutputRef; mapContainerRef: Signal>; private map?; private resizeObserver?; constructor(); private getProjectedCoordinate; private getExternalCoordinate; private initMap; private destroyMap; private updateCenter; private updateZoom; private updateRotation; private emitViewChange; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } /** * Options for animating the map view. */ interface AnimationOptions { /** Target center coordinate */ center?: Coordinate; /** Target zoom level */ zoom?: number; /** Target rotation in radians */ rotation?: number; /** Animation duration in milliseconds */ duration?: number; } /** * Options for fitting the view to an extent. */ interface FitOptions { /** Padding around the extent [top, right, bottom, left] */ padding?: [number, number, number, number]; /** Maximum zoom level to use */ maxZoom?: number; /** Animation duration in milliseconds */ duration?: number; } /** * Configuration options for the map view. */ interface MapViewOptions { /** Initial center coordinate */ center?: Coordinate; /** Initial zoom level */ zoom?: number; /** Minimum allowed zoom */ minZoom?: number; /** Maximum allowed zoom */ maxZoom?: number; /** Initial rotation in radians */ rotation?: number; /** Map projection (e.g., 'EPSG:3857') */ projection?: string; } declare class OlMapService { private zoneHelper; private map; private readyCallbacks; private _center; private _zoom; private _rotation; private _resolution; readonly center: Signal; readonly zoom: Signal; readonly rotation: Signal; /** Signal that emits the current map resolution in meters per pixel */ readonly resolution: Signal; setMap(map: OLMap | null): void; setResolution(resolution: number): void; updateViewState(center: Coordinate, zoom: number, rotation: number): void; getMap(): OLMap | null; onReady(callback: (map: OLMap) => void): void; getView(): View | null; setCenter(coordinate: Coordinate): void; setZoom(level: number): void; fitExtent(extent: Extent, options?: FitOptions): void; animateView(options: AnimationOptions): Promise; getViewState(): { center: Coordinate; zoom: number; rotation: number; }; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } /** * Helper service that abstracts NgZone operations for zoneless compatibility. * * When NgZone is available (classic Angular): * - runOutsideAngular: executes outside Angular's zone for performance * - runInsideAngular: executes inside Angular's zone to trigger change detection * * When zoneless (signals-only Angular): * - Both methods execute directly since signals handle reactivity * * @usageNotes * Inject this service instead of NgZone directly: * ```ts * private zoneHelper = inject(OlZoneHelper); * * this.zoneHelper.runOutsideAngular(() => { * // OpenLayers operations that don't need CD * }); * ``` */ declare class OlZoneHelper { private ngZone; /** * Runs callback outside Angular zone if available (for performance with NgZone), * or directly if zoneless. * * Use for: OpenLayers operations that don't need to trigger Angular change detection * (map manipulation, event listeners, animations) */ runOutsideAngular(fn: () => T): T; /** * Runs callback inside Angular zone if available (for triggering CD), * or directly if zoneless. * * Use for: Emitting outputs that should be handled by parent components */ runInsideAngular(fn: () => T): T; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } /** * Configuration for an ellipse polygon centered at `center`. * Coordinates are emitted in EPSG:4326 (lon/lat) using a local tangent-plane * approximation; accuracy degrades for radii > ~100 km or near the poles. */ interface EllipseConfig { /** Ellipse center as `[lon, lat]` in EPSG:4326. */ center: Coordinate; /** Semi-major axis in meters. Must be > 0. */ semiMajor: number; /** Semi-minor axis in meters. Must be > 0. */ semiMinor: number; /** * Rotation in radians, counter-clockwise from East. Default: 0 * (semi-major axis points East). */ rotation?: number; /** * Number of vertices used to approximate the ellipse. Default: 64. * Minimum: 8. */ segments?: number; /** Custom feature properties to attach to the output feature. */ properties?: Record; } /** * Configuration for a circular sector (pie-slice) polygon. * Same projection caveats as `EllipseConfig`. */ interface SectorConfig { /** Sector apex / center as `[lon, lat]` in EPSG:4326. */ center: Coordinate; /** Sector radius in meters. Must be > 0. */ radius: number; /** Start angle in radians (0 = East, CCW positive). */ startAngle: number; /** * End angle in radians. Must satisfy `startAngle < endAngle <= startAngle + 2π`. */ endAngle: number; /** * Number of vertices along the arc. Default: 32. Minimum: 4. The output * polygon has `segments + 3` vertices (apex + arc + apex closer). */ segments?: number; /** Custom feature properties to attach to the output feature. */ properties?: Record; } /** * Configuration for a donut (annular ring) polygon — a disk with a * concentric circular hole. * * The output `Feature` has TWO rings: an outer ring (CCW) and * an inner ring (CW per the GeoJSON right-hand rule), so renderers that * follow the spec fill only the band between the radii. */ interface DonutConfig { /** Donut center as `[lon, lat]` in EPSG:4326. */ center: Coordinate; /** Outer radius in meters. Must be > `innerRadius`. */ outerRadius: number; /** Inner radius in meters. Must be > 0 and < `outerRadius`. */ innerRadius: number; /** * Number of vertices per ring. Default: 64. Minimum: 8. Both rings use * the same segment count. */ segments?: number; /** Custom feature properties to attach to the output feature. */ properties?: Record; } /** * Service exposing general purpose geometry helpers for creating * approximated polygons (ellipses, sectors, donuts) from metric parameters. */ declare class OlGeometryService { private idCounter; /** * Build a `Feature` approximating an ellipse centered at * `config.center`. See {@link EllipseConfig} for parameter semantics. */ createEllipse(config: EllipseConfig): Feature; /** * Build a `Feature` for a circular sector (pie slice). * See {@link SectorConfig} for parameter semantics. */ createSector(config: SectorConfig): Feature; /** * Build a `Feature` for a donut (annular ring). The output has * two rings: an outer ring wound counter-clockwise and an inner ring * wound clockwise so the GeoJSON right-hand rule renders the hole. */ createDonut(config: DonutConfig): Feature; /** * Project an `(dx, dy)` meter offset from `center` to lon/lat using true * geodesic math (Vincenty's formulae) via ol/sphere. */ offsetMetersToLonLat(center: Coordinate, dx: number, dy: number): Coordinate; private nextId; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } /** * Service for orchestrating time-series animations in OpenLayers. * Exposes a reactive currentTime signal that updates outside the Angular zone * via requestAnimationFrame, ensuring 60FPS WebGL animations without triggering * global change detection. */ declare class OlTimeService { private zoneHelper; private timeSignal; private playingSignal; private speedSignal; private animationFrameId; private lastTick; readonly currentTime: Signal; readonly isPlaying: Signal; readonly speed: Signal; /** * Sets the current time manually. * @param time Epoch timestamp in milliseconds */ setTime(time: number): void; /** * Sets the playback speed multiplier. * @param speed Multiplier (e.g. 1 = real time, 60 = 1 minute per second) */ setSpeed(speed: number): void; /** * Starts the time animation loop. */ play(): void; /** * Pauses the time animation loop. */ pause(): void; /** * Stops the animation and resets to a specific time. */ stop(resetTime?: number): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } interface VectorResourceOptions { /** Optional custom fetch options */ fetchOptions?: RequestInit; } /** * Creates an Angular resource for fetching and decoding GeoJSON into OpenLayers Features. * Must be called in an injection context. * * @param url The URL signal or string to fetch data from * @param options Additional vector resource options * @returns An Angular Resource containing an array of parsed Features */ declare function createVectorResource(url: Signal, options?: VectorResourceOptions): ResourceRef; interface ProjectionOptions { sourceProjection?: string; targetProjection?: string; } /** * Converts an OpenLayers feature to the internal Feature format. * Handles coordinate extraction and geometry type mapping with custom projections. * * @param olFeature - The OpenLayers feature to convert * @param options - Projection source and target codes * @returns The converted Feature with normalized structure */ declare function olFeatureToFeature(olFeature: Feature$1, options?: ProjectionOptions): Feature; /** * Converts an internal Feature to an OpenLayers feature. */ declare function featureToOlFeature(feature: Feature, options?: ProjectionOptions): Feature$1; type OlFeatureKind = 'layers' | 'controls' | 'interactions' | 'overlays' | 'military' | 'projections'; interface OlFeature { kind: Kind; providers: Provider[]; } declare function provideOpenLayers(...features: OlFeature[]): EnvironmentProviders; interface Proj4Definition { code: string; def: string; extent?: [number, number, number, number]; } /** * Registers custom projections using proj4. * * @param proj4 - The proj4 instance (must be passed to avoid strong dependency on proj4 package) * @param definitions - Array of projection definitions * @returns OlFeature for projections */ declare function withProjections(proj4: any, definitions: Proj4Definition[]): OlFeature<'projections'>; export { OlGeometryService, OlMapComponent, OlMapService, OlTimeService, OlZoneHelper, createVectorResource, featureToOlFeature, olFeatureToFeature, provideOpenLayers, withProjections }; export type { AnimationOptions, Coordinate, DonutConfig, EllipseConfig, Extent, Feature, FitOptions, Geometry, GeometryType, Layer, MapClickEvent, MapConfig, MapViewOptions, OlFeature, OlFeatureKind, Pixel, Proj4Definition, ProjectionCode, SectorConfig, Style, VectorResourceOptions, ViewState };