UNPKG

rlayers

Version:

React Components for OpenLayers

62 lines 2.32 kB
import React from 'react'; import { Tile as LayerTile } from 'ol/layer'; import BaseEvent from 'ol/events/Event'; import { RContextType } from '../context'; import { default as RLayerRaster, RLayerRasterProps } from './RLayerRaster'; import type * as MBTiles from 'ol-mbtiles'; /** * @propsfor RLayerRasterMBTiles */ export interface RLayerRasterMBTilesProps extends RLayerRasterProps { /** An URL for a remote MBTiles file */ url: string; /** * Use multiple SQLite workers, refer to the ol-mbtiles for more information * @default 4 */ workers?: number; /** * Use a specific HTTP backend, refer to the ol-mbtiles for more information * @default 'sync' */ backend?: 'sync' | 'shared'; /** * Cache size in KBytes to use for SQLite * @default 4096 */ sqlCacheSize?: number; /** * Maximum SQLite page size in bytes, reduce to 1024 if you have optimized your files * @default 4096 */ maxSqlPageSize?: number; /** Called after each metadata change to signal that the metadata has been loaded */ onMetadataReady?: (this: RLayerRasterMBTiles, md: MBTiles.MBTilesRasterOptions & MBTiles.SQLOptions) => void; /** Called by OpenLayers when the layer is ready to start rendering */ onSourceReady?: (this: RLayerRasterMBTiles, e: BaseEvent) => void; } /** * A layer from a remote MBTiles raster source * * WARNING: Using this module requires manually installing `ol-mbtiles` * * `npm install ol-mbtiles` * * Be sure to read its own documentation for tips on how to improve * its performance (COOP/COEP, WASM compression, preloading...) * * Requires an `RMap` context */ export default class RLayerRasterMBTiles extends RLayerRaster<RLayerRasterMBTilesProps> { addon: Promise<typeof MBTiles>; metadata: Promise<MBTiles.MBTilesRasterOptions & MBTiles.SQLOptions>; ol: LayerTile<MBTiles.MBTilesRasterSource>; source: MBTiles.MBTilesRasterSource; private abort; constructor(props: Readonly<RLayerRasterMBTilesProps>, context?: React.Context<RContextType>); protected createSource(): void; protected destroySource(): void; componentWillUnmount(): void; protected refresh(prevProps?: RLayerRasterMBTilesProps): void; } //# sourceMappingURL=RLayerRasterMBTiles.d.ts.map