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

@@ -10,6 +10,7 @@ import {
} from '../style/Style.js';
/**
* @template {import("../source/Vector.js").default|import("../source/VectorTile.js").default} VectorSourceType
* @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).
@@ -34,7 +35,7 @@ import {
* @property {number} [renderBuffer=100] The buffer in pixels around the viewport extent used by the
* renderer when getting features from the vector source for the rendering or hit-detection.
* Recommended value: the size of the largest symbol, line width or label.
* @property {import("../source/Vector.js").default} [source] Source.
* @property {VectorSourceType} [source] Source.
* @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
@@ -77,7 +78,7 @@ const Property = {
*/
class BaseVectorLayer extends Layer {
/**
* @param {Options} [opt_options] Options.
* @param {Options<VectorSourceType>} [opt_options] Options.
*/
constructor(opt_options) {
const options = opt_options ? opt_options : {};