Allow WebGL tile layer style to be updated
This commit is contained in:
@@ -90,6 +90,17 @@ class WebGLLayerRenderer extends LayerRenderer {
|
||||
layer.addChangeListener(LayerProperty.MAP, this.removeHelper_.bind(this));
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset options (only handles uniforms).
|
||||
* @param {Options} options Options.
|
||||
*/
|
||||
reset(options) {
|
||||
this.uniforms_ = options.uniforms;
|
||||
if (this.helper) {
|
||||
this.helper.setUniforms(this.uniforms_);
|
||||
}
|
||||
}
|
||||
|
||||
removeHelper_() {
|
||||
if (this.helper) {
|
||||
this.helper.dispose();
|
||||
|
||||
@@ -213,6 +213,24 @@ class WebGLTileLayerRenderer extends WebGLLayerRenderer {
|
||||
this.tileTextureCache_ = new LRUCache(cacheSize);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Options} options Options.
|
||||
*/
|
||||
reset(options) {
|
||||
super.reset({
|
||||
uniforms: options.uniforms,
|
||||
});
|
||||
this.vertexShader_ = options.vertexShader;
|
||||
this.fragmentShader_ = options.fragmentShader;
|
||||
|
||||
if (this.helper) {
|
||||
this.program_ = this.helper.getProgram(
|
||||
this.fragmentShader_,
|
||||
this.vertexShader_
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
afterHelperCreated() {
|
||||
this.program_ = this.helper.getProgram(
|
||||
this.fragmentShader_,
|
||||
|
||||
Reference in New Issue
Block a user