rlayers
Version:
React Components for OpenLayers
73 lines • 2.98 kB
TypeScript
import React from 'react';
import { VectorTile as LayerVectorTile } from 'ol/layer';
import { VectorTile as SourceVectorTile } from 'ol/source';
import type { Options } from 'ol/source/VectorTile';
import FeatureFormat from 'ol/format/Feature';
import { RContextType } from '../context';
import { default as RLayer, RLayerProps } from './RLayer';
import { RFeatureUIEvent } from '../RFeature';
import { OLEvent } from '../REvent';
import { RStyleLike } from '../style/RStyle';
/**
* @propsfor RLayerVectorTile
*/
export interface RLayerVectorTileProps extends RLayerProps {
/** URL for the tiles, normal {x}{y}{z} convention applies */
url: string;
/**
* Style to be used for rendering the features
* You can use a dynamic style, but the property value must stay the same
* ie switching from a static OpenLayers style to a RefObject is not supported
*/
style?: RStyleLike;
/** Vector tile format */
format: FeatureFormat;
/**
* Width of the frame around the viewport that shall be rendered too
* so that the symbols, whose center is outside of the viewport,
* but are partially inside, can be rendered
*
* this property currently does not support dynamic updates
*/
renderBuffer?: number;
extent?: Options['extent'];
overlaps?: Options['overlaps'];
state?: Options['state'];
tileClass?: Options['tileClass'];
tileSize?: Options['tileSize'];
tileGrid?: Options['tileGrid'];
tileLoadFunction?: Options['tileLoadFunction'];
tileUrlFunction?: Options['tileUrlFunction'];
transition?: Options['transition'];
zDirection?: Options['zDirection'];
/** onClick handler for loaded features */
onClick?: (this: RLayerVectorTile, e: RFeatureUIEvent) => boolean | void;
/** onPointerMove handler for loaded features */
onPointerMove?: (this: RLayerVectorTile, e: RFeatureUIEvent) => boolean | void;
/** onPointerEnter handler for loaded features */
onPointerEnter?: (this: RLayerVectorTile, e: RFeatureUIEvent) => boolean | void;
/** onPointerLeave handler for loaded features */
onPointerLeave?: (this: RLayerVectorTile, e: RFeatureUIEvent) => boolean | void;
}
/**
* A vector tile layer
*
* Supports loading of features from vector tile servers
*
* Only the handlers can be dynamically modified
*
* Requires an `RMap` context
*
* It does not provide a vector layer context for JSX-declared `RFeature`s
* and it is not compatible with RLayerVector
*/
export default class RLayerVectorTile extends RLayer<RLayerVectorTileProps> {
ol: LayerVectorTile;
source: SourceVectorTile;
constructor(props: Readonly<RLayerVectorTileProps>, context?: React.Context<RContextType>);
protected incrementHandlers(ev: OLEvent): void;
protected decrementHandlers(ev: OLEvent): void;
protected refresh(prevProps?: RLayerVectorTileProps): void;
render(): JSX.Element;
}
//# sourceMappingURL=RLayerVectorTile.d.ts.map