110 lines
3.1 KiB
JavaScript
110 lines
3.1 KiB
JavaScript
import {
|
|
Layer_default
|
|
} from "./chunk-S5OMZ56B.js";
|
|
|
|
// node_modules/ol/layer/TileProperty.js
|
|
var TileProperty_default = {
|
|
PRELOAD: "preload",
|
|
USE_INTERIM_TILES_ON_ERROR: "useInterimTilesOnError"
|
|
};
|
|
|
|
// node_modules/ol/layer/BaseTile.js
|
|
var BaseTileLayer = class extends Layer_default {
|
|
/**
|
|
* @param {Options<TileSourceType>} [options] Tile layer options.
|
|
*/
|
|
constructor(options) {
|
|
options = options ? options : {};
|
|
const baseOptions = Object.assign({}, options);
|
|
const cacheSize = options.cacheSize;
|
|
delete options.cacheSize;
|
|
delete baseOptions.preload;
|
|
delete baseOptions.useInterimTilesOnError;
|
|
super(baseOptions);
|
|
this.on;
|
|
this.once;
|
|
this.un;
|
|
this.cacheSize_ = cacheSize;
|
|
this.setPreload(options.preload !== void 0 ? options.preload : 0);
|
|
this.setUseInterimTilesOnError(
|
|
options.useInterimTilesOnError !== void 0 ? options.useInterimTilesOnError : true
|
|
);
|
|
}
|
|
/**
|
|
* @return {number|undefined} The suggested cache size
|
|
* @protected
|
|
*/
|
|
getCacheSize() {
|
|
return this.cacheSize_;
|
|
}
|
|
/**
|
|
* Return the level as number to which we will preload tiles up to.
|
|
* @return {number} The level to preload tiles up to.
|
|
* @observable
|
|
* @api
|
|
*/
|
|
getPreload() {
|
|
return (
|
|
/** @type {number} */
|
|
this.get(TileProperty_default.PRELOAD)
|
|
);
|
|
}
|
|
/**
|
|
* Set the level as number to which we will preload tiles up to.
|
|
* @param {number} preload The level to preload tiles up to.
|
|
* @observable
|
|
* @api
|
|
*/
|
|
setPreload(preload) {
|
|
this.set(TileProperty_default.PRELOAD, preload);
|
|
}
|
|
/**
|
|
* Deprecated. Whether we use interim tiles on error.
|
|
* @return {boolean} Use interim tiles on error.
|
|
* @observable
|
|
* @api
|
|
*/
|
|
getUseInterimTilesOnError() {
|
|
return (
|
|
/** @type {boolean} */
|
|
this.get(TileProperty_default.USE_INTERIM_TILES_ON_ERROR)
|
|
);
|
|
}
|
|
/**
|
|
* Deprecated. Set whether we use interim tiles on error.
|
|
* @param {boolean} useInterimTilesOnError Use interim tiles on error.
|
|
* @observable
|
|
* @api
|
|
*/
|
|
setUseInterimTilesOnError(useInterimTilesOnError) {
|
|
this.set(TileProperty_default.USE_INTERIM_TILES_ON_ERROR, useInterimTilesOnError);
|
|
}
|
|
/**
|
|
* Get data for a pixel location. The return type depends on the source data. For image tiles,
|
|
* a four element RGBA array will be returned. For data tiles, the array length will match the
|
|
* number of bands in the dataset. For requests outside the layer extent, `null` will be returned.
|
|
* Data for a image tiles can only be retrieved if the source's `crossOrigin` property is set.
|
|
*
|
|
* ```js
|
|
* // display layer data on every pointer move
|
|
* map.on('pointermove', (event) => {
|
|
* console.log(layer.getData(event.pixel));
|
|
* });
|
|
* ```
|
|
* @param {import("../pixel").Pixel} pixel Pixel.
|
|
* @return {Uint8ClampedArray|Uint8Array|Float32Array|DataView|null} Pixel data.
|
|
* @api
|
|
* @override
|
|
*/
|
|
getData(pixel) {
|
|
return super.getData(pixel);
|
|
}
|
|
};
|
|
var BaseTile_default = BaseTileLayer;
|
|
|
|
export {
|
|
TileProperty_default,
|
|
BaseTile_default
|
|
};
|
|
//# sourceMappingURL=chunk-4V7XJAUG.js.map
|