UNPKG

rlayers

Version:

React Components for OpenLayers

46 lines 1.59 kB
import { Feature } from 'ol'; import { Vector as LayerVector } from 'ol/layer'; import { Vector as SourceVector } from 'ol/source'; import { FeatureLike } from 'ol/Feature'; import { default as RLayerBaseVector, RLayerBaseVectorProps } from './RLayerBaseVector'; import BaseObject from 'ol/Object'; import { Geometry } from 'ol/geom'; /** * A vector layer * * Supports loading of features from external sources. * * Requires an `RMap` context. * * Provides a vector layer context for JSX-declared `RFeature`s. * * @example * <RLayerVector> * <RFeature geometry={geom1} /> * <RFeature geometry={geom2} /> * </RLayerVector> * * Features can also be typed when using TSX: * * @example * <RLayerVector<Feature<Point>> * <RFeature geometry={point1} /> * <RFeature geometry={point1} /> * </RLayerVector> * * In this case, all callbacks will be automatically typed. * * Since 3.0, RLayerVector also supports OpenLayers light-weight RenderFeatures. * Currently these light-weight feature cannot be created using TSX/JSX and must * be read from a file. * * @example * <RLayerVector<RenderFeature> format={new GeoJSON({featureProjection: 'EPSG:3857'})} /> */ export default class RLayerVector<F extends FeatureLike = Feature<Geometry>> extends RLayerBaseVector<F, RLayerBaseVectorProps<F>> { ol: LayerVector<SourceVector<F>, F>; source: SourceVector<F>; protected createSource(props: Readonly<RLayerBaseVectorProps<F>>): BaseObject[]; protected refresh(prevProps?: RLayerBaseVectorProps<F>): void; } //# sourceMappingURL=RLayerVector.d.ts.map