UNPKG

rlayers

Version:

React Components for OpenLayers

77 lines 3.37 kB
import React from 'react'; import { Map as Map } from 'ol'; import Layer from 'ol/layer/Layer'; import Source from 'ol/source/Source'; import BaseVector from 'ol/layer/BaseVector'; import SourceVector from 'ol/source/Vector'; import VectorTile from 'ol/layer/VectorTile'; import CanvasVectorLayerRenderer from 'ol/renderer/canvas/VectorLayer'; import CanvasVectorTileLayerRenderer from 'ol/renderer/canvas/VectorTileLayer'; import CanvasVectorImageLayerRenderer from 'ol/renderer/canvas/VectorImageLayer'; import WebGLPointsLayerRenderer from 'ol/renderer/webgl/PointsLayer'; import { Feature } from 'ol'; import { Coordinate } from 'ol/coordinate'; import Style from 'ol/style/Style'; import Geometry from 'ol/geom/Geometry'; import LayerRenderer from 'ol/renderer/Layer'; import JSONFeature from 'ol/format/JSONFeature'; import RMap from './RMap'; import RLayer, { RLayerProps } from './layer/RLayer'; import RLayerBaseVector, { RLayerBaseVectorProps } from './layer/RLayerBaseVector'; import RFeature from './RFeature'; import RLayerVectorTile from './layer/RLayerVectorTile'; import RenderFeature from 'ol/render/Feature'; export declare const RContext: React.Context<RContextType>; export type OLFeatureClass = RenderFeature extends ReturnType<JSONFeature['readFeatures']>[0] ? Feature<Geometry> : Geometry; /** * Context type */ export interface RContextType { /** The current map */ readonly map?: Map; /** The current layer */ readonly layer?: Layer<Source, LayerRenderer<any>>; readonly source?: Source; /** The current vector layer */ readonly vectorlayer?: BaseVector<SourceVector<OLFeatureClass>, CanvasVectorLayerRenderer | CanvasVectorTileLayerRenderer | CanvasVectorImageLayerRenderer | WebGLPointsLayerRenderer>; readonly vectorsource?: SourceVector<OLFeatureClass>; readonly vectortilelayer?: VectorTile; /** The current RFeature */ readonly feature?: Feature<Geometry>; /** The current location */ readonly location?: Coordinate; /** The current style */ readonly style?: Style; /** The current style array */ readonly styleArray?: Style[]; /** The current RMap component */ readonly rMap?: RMap; /** The current RLayer component */ readonly rLayer?: RLayer<RLayerProps>; /** The current RLayerVector component */ readonly rLayerVector?: RLayerBaseVector<OLFeatureClass, RLayerBaseVectorProps>; /** The current RLayerVectorTile component */ readonly rLayerVectorTile?: RLayerVectorTile; /** The current RFeature component */ readonly rFeature?: RFeature; } export declare function useOL(): { map: Map; layer: Layer<Source, LayerRenderer<any>>; source: Source; vectorlayer: BaseVector<SourceVector<Feature<Geometry>>, CanvasVectorLayerRenderer | CanvasVectorTileLayerRenderer | CanvasVectorImageLayerRenderer | WebGLPointsLayerRenderer>; vectorsource: SourceVector<Feature<Geometry>>; vectortilelayer: VectorTile; feature: Feature<Geometry>; location: Coordinate; style: Style; styleArray: Style[]; }; export declare function useRLayersComponent(): { rMap: RMap; rLayer: RLayer<RLayerProps>; rLayerVector: RLayerBaseVector<Feature<Geometry>, RLayerBaseVectorProps<Feature<Geometry>>>; rLayerVectorTile: RLayerVectorTile; rFeature: RFeature; }; //# sourceMappingURL=context.d.ts.map