UNPKG

rlayers

Version:

React Components for OpenLayers

29 lines 954 B
import { Tile as LayerTile } from 'ol/layer'; // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore import { StadiaMaps } from 'ol/source'; import { default as RLayerRaster } from './RLayerRaster'; /** * A ready to use interface for Stadia Maps's map service * * Requires OpenLayers 8.0 and must be imported separately * * `import RLayerStadia from 'rlayers/layer/RLayerStadia';` * * * Requires an `RMap` context */ export default class RLayerStadia extends RLayerRaster { constructor(props, context) { var _a; super(props, context); this.source = new StadiaMaps({ layer: this.props.layer, apiKey: this.props.apiKey, retina: (_a = this.props.retina) !== null && _a !== void 0 ? _a : false }); this.ol = new LayerTile({ source: this.source }); this.eventSources = [this.ol, this.source]; } } //# sourceMappingURL=RLayerStadia.js.map