diff --git a/examples/webgl-points-layer.js b/examples/webgl-points-layer.js index 024f28d020..203f826bfa 100644 --- a/examples/webgl-points-layer.js +++ b/examples/webgl-points-layer.js @@ -43,7 +43,7 @@ function refreshLayer() { } pointsLayer = new WebGLPointsLayer({ source: vectorSource, - literalStyle: literalStyle + style: literalStyle }); map.addLayer(pointsLayer); editor.value = JSON.stringify(literalStyle, null, ' '); diff --git a/rendering/cases/webgl-points/main.js b/rendering/cases/webgl-points/main.js index 27fcf28355..9dbbf89b3a 100644 --- a/rendering/cases/webgl-points/main.js +++ b/rendering/cases/webgl-points/main.js @@ -13,7 +13,7 @@ const vector = new WebGLPointsLayer({ extractStyles: false }) }), - literalStyle: { + style: { symbol: { size: 4, color: 'white' diff --git a/src/ol/layer/WebGLPoints.js b/src/ol/layer/WebGLPoints.js index de0baa88f1..9da441e560 100644 --- a/src/ol/layer/WebGLPoints.js +++ b/src/ol/layer/WebGLPoints.js @@ -17,7 +17,7 @@ import Layer from './Layer.js'; /** * @typedef {Object} Options - * @property {import('../style/LiteralStyle.js').LiteralStyle} literalStyle Literal style to apply to the layer features. + * @property {import('../style/LiteralStyle.js').LiteralStyle} style Literal style to apply to the layer features. * @property {string} [className='ol-layer'] A CSS class name to set to the layer element. * @property {number} [opacity=1] Opacity (0, 1). * @property {boolean} [visible=true] Visibility. @@ -37,7 +37,7 @@ import Layer from './Layer.js'; /** * @classdesc - * Layer optimized for rendering large point datasets. Takes a so-called *literalStyle* property which + * Layer optimized for rendering large point datasets. Takes a `style` property which * is a serializable JSON object describing how the layer should be rendered. * * Here are a few samples of literal style objects: @@ -81,16 +81,16 @@ class WebGLPointsLayer extends Layer { /** * @type {import('../style/LiteralStyle.js').LiteralStyle} */ - this.literalStyle = options.literalStyle; + this.style = options.style; - assert(this.literalStyle.symbol !== undefined, 65); + assert(this.style.symbol !== undefined, 65); } /** * @inheritDoc */ createRenderer() { - const symbolStyle = this.literalStyle.symbol; + const symbolStyle = this.style.symbol; const size = Array.isArray(symbolStyle.size) ? formatArray(symbolStyle.size) : formatNumber(symbolStyle.size); const color = symbolStyle.color !== undefined ?