UNPKG

mobility-toolbox-js

Version:

Toolbox for JavaScript applications in the domains of mobility and logistics.

23 lines (22 loc) 1.14 kB
import CanvasLayerRenderer from 'ol/renderer/canvas/Layer'; import type { Feature } from 'ol'; import type { Coordinate } from 'ol/coordinate'; import type { Geometry } from 'ol/geom'; import type { FrameState } from 'ol/Map'; import type { Pixel } from 'ol/pixel'; import type { FeatureCallback } from 'ol/renderer/vector'; import type RealtimeLayer from '../layers/RealtimeLayer'; /** * This class is a renderer for Maplibre Layer to be able to use the native ol * functionnalities like map.getFeaturesAtPixel or map.hasFeatureAtPixel. * @private */ export default class RealtimeLayerRenderer extends CanvasLayerRenderer<RealtimeLayer> { private canvas; forEachFeatureAtCoordinate<Feature>(coordinate: Coordinate, frameState: FrameState, hitTolerance: number, callback: FeatureCallback<Feature>): Feature | undefined; getData(pixel: Pixel): ImageDataArray | null; getFeatures(pixel: Pixel): Promise<Feature<Geometry>[]>; getFeaturesAtCoordinate(coordinate: Coordinate | undefined, hitTolerance?: number): Feature<Geometry>[]; prepareFrame(): boolean; renderFrame(frameState: FrameState): HTMLElement; }