UNPKG

hmpps-open-layers-map

Version:

A native Web Component for displaying maps using OpenLayers.

34 lines (33 loc) 1.14 kB
import VectorLayer from 'ol/layer/Vector'; import VectorSource from 'ol/source/Vector'; import type Feature from 'ol/Feature'; import type { LineString } from 'ol/geom'; import type { FeatureCollection } from 'geojson'; import type { ComposableLayer, LayerStateOptions } from './base'; import type { MapAdapter } from '../map-adapter'; type OLLineFeature = Feature<LineString>; type OLVecSource = VectorSource<OLLineFeature>; type OLVecLayer = VectorLayer<OLVecSource>; export type LinesLayerOptions = { id?: string; title?: string; visible?: boolean; zIndex?: number; style?: { width?: number; color?: string; }; }; export type LinesLayerConstructorOptions = LinesLayerOptions & { geoJson: FeatureCollection; }; export declare class LinesLayer implements ComposableLayer<OLVecLayer> { readonly id: string; private readonly options; private olLayer?; constructor(options: LinesLayerConstructorOptions); getNativeLayer(): OLVecLayer | undefined; attach(adapter: MapAdapter, layerStateOptions?: LayerStateOptions): void; detach(adapter: MapAdapter): void; } export {};