Added generic source option to layer option types

This commit is contained in:
Simon Seyock
2021-02-26 11:24:15 +01:00
committed by Andreas Hocevar
parent 8520a18eae
commit a211666fd8
10 changed files with 24 additions and 16 deletions

View File

@@ -6,6 +6,7 @@ import TileProperty from './TileProperty.js';
import {assign} from '../obj.js';
/**
* @template {import("../source/Tile.js").default} TileSourceType
* @typedef {Object} Options
* @property {string} [className='ol-layer'] A CSS class name to set to the layer element.
* @property {number} [opacity=1] Opacity (0, 1).
@@ -26,7 +27,7 @@ import {assign} from '../obj.js';
* be visible.
* @property {number} [preload=0] Preload. Load low-resolution tiles up to `preload` levels. `0`
* means no preloading.
* @property {import("../source/Tile.js").default} [source] Source for this layer.
* @property {TileSourceType} [source] Source for this layer.
* @property {import("../PluggableMap.js").default} [map] Sets the layer as overlay on a map. The map will not manage
* this layer in its layers collection, and the layer will be rendered on top. This is useful for
* temporary layers. The standard way to add a layer to a map and have it managed by the map is to
@@ -49,7 +50,7 @@ import {assign} from '../obj.js';
*/
class BaseTileLayer extends Layer {
/**
* @param {Options} [opt_options] Tile layer options.
* @param {Options<TileSourceType>} [opt_options] Tile layer options.
*/
constructor(opt_options) {
const options = opt_options ? opt_options : {};