Add updateStyleVariables method to WebGLPoints layer
This commit is contained in:
@@ -87,6 +87,12 @@ class WebGLPointsLayer extends Layer {
|
||||
*/
|
||||
this.parseResult_ = parseLiteralStyle(options.style);
|
||||
|
||||
/**
|
||||
* @type {Object<string, (string|number)>}
|
||||
* @private
|
||||
*/
|
||||
this.styleVariables_ = options.style.variables || {};
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {boolean}
|
||||
@@ -108,6 +114,15 @@ class WebGLPointsLayer extends Layer {
|
||||
attributes: this.parseResult_.attributes,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Update any variables used by the layer style and trigger a re-render.
|
||||
* @param {Object<string, number>} variables Variables to update.
|
||||
*/
|
||||
updateStyleVariables(variables) {
|
||||
assign(this.styleVariables_, variables);
|
||||
this.changed();
|
||||
}
|
||||
}
|
||||
|
||||
export default WebGLPointsLayer;
|
||||
|
||||
Reference in New Issue
Block a user