Webgl renderer / now accepts any kind of layer (not just vector)
This commit is contained in:
@@ -108,15 +108,15 @@ import {assert} from '../../asserts.js';
|
|||||||
class WebGLPointsLayerRenderer extends WebGLLayerRenderer {
|
class WebGLPointsLayerRenderer extends WebGLLayerRenderer {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {import("../../layer/Vector.js").default} vectorLayer Vector layer.
|
* @param {import("../../layer/Layer.js").default} layer Layer.
|
||||||
* @param {Options=} options Options.
|
* @param {Options=} options Options.
|
||||||
*/
|
*/
|
||||||
constructor(vectorLayer, options) {
|
constructor(layer, options) {
|
||||||
const uniforms = options.uniforms || {};
|
const uniforms = options.uniforms || {};
|
||||||
const projectionMatrixTransform = createTransform();
|
const projectionMatrixTransform = createTransform();
|
||||||
uniforms[DefaultUniform.PROJECTION_MATRIX] = projectionMatrixTransform;
|
uniforms[DefaultUniform.PROJECTION_MATRIX] = projectionMatrixTransform;
|
||||||
|
|
||||||
super(vectorLayer, {
|
super(layer, {
|
||||||
uniforms: uniforms,
|
uniforms: uniforms,
|
||||||
postProcesses: options.postProcesses
|
postProcesses: options.postProcesses
|
||||||
});
|
});
|
||||||
@@ -289,8 +289,8 @@ class WebGLPointsLayerRenderer extends WebGLLayerRenderer {
|
|||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
prepareFrame(frameState) {
|
prepareFrame(frameState) {
|
||||||
const vectorLayer = this.getLayer();
|
const layer = this.getLayer();
|
||||||
const vectorSource = vectorLayer.getSource();
|
const vectorSource = layer.getSource();
|
||||||
const viewState = frameState.viewState;
|
const viewState = frameState.viewState;
|
||||||
|
|
||||||
// the source has changed: clear the feature cache & reload features
|
// the source has changed: clear the feature cache & reload features
|
||||||
@@ -332,8 +332,8 @@ class WebGLPointsLayerRenderer extends WebGLLayerRenderer {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
rebuildBuffers_(frameState) {
|
rebuildBuffers_(frameState) {
|
||||||
const vectorLayer = this.getLayer();
|
const layer = this.getLayer();
|
||||||
const vectorSource = vectorLayer.getSource();
|
const vectorSource = layer.getSource();
|
||||||
|
|
||||||
// saves the projection transform for the current frame state
|
// saves the projection transform for the current frame state
|
||||||
const projectionTransform = createTransform();
|
const projectionTransform = createTransform();
|
||||||
|
|||||||
Reference in New Issue
Block a user