hmpps-open-layers-map
Version:
A native Web Component for displaying maps using OpenLayers or MapLibre.
33 lines (32 loc) • 1.06 kB
TypeScript
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 { ComposableLayer, LayerStateOptions } from './base';
import type { MapAdapter } from '../map-adapter';
import Position from '../types/position';
type OLLineFeature = Feature<LineString>;
type OLVecSource = VectorSource<OLLineFeature>;
type OLVecLayer = VectorLayer<OLVecSource>;
export type LinesLayerOptions = {
id?: string;
title?: string;
visible?: boolean;
zIndex?: number;
style?: {
stroke: {
color: string;
};
};
positions: Array<Position>;
};
export declare class LinesLayer implements ComposableLayer<OLVecLayer> {
readonly id: string;
private readonly options;
private olLayer?;
constructor(options: LinesLayerOptions);
getNativeLayer(): OLVecLayer | undefined;
attach(adapter: MapAdapter, layerStateOptions?: LayerStateOptions): void;
detach(adapter: MapAdapter): void;
}
export {};