Merge pull request #10722 from jellyedwards/master
fix: handle layer clear event in case clear(true) called
This commit is contained in:
@@ -290,7 +290,8 @@ class WebGLPointsLayerRenderer extends WebGLLayerRenderer {
|
|||||||
this.sourceListenKeys_ = [
|
this.sourceListenKeys_ = [
|
||||||
listen(source, VectorEventType.ADDFEATURE, this.handleSourceFeatureAdded_, this),
|
listen(source, VectorEventType.ADDFEATURE, this.handleSourceFeatureAdded_, this),
|
||||||
listen(source, VectorEventType.CHANGEFEATURE, this.handleSourceFeatureChanged_, this),
|
listen(source, VectorEventType.CHANGEFEATURE, this.handleSourceFeatureChanged_, this),
|
||||||
listen(source, VectorEventType.REMOVEFEATURE, this.handleSourceFeatureDelete_, this)
|
listen(source, VectorEventType.REMOVEFEATURE, this.handleSourceFeatureDelete_, this),
|
||||||
|
listen(source, VectorEventType.CLEAR, this.handleSourceFeatureClear_, this)
|
||||||
];
|
];
|
||||||
source.forEachFeature(function(feature) {
|
source.forEachFeature(function(feature) {
|
||||||
this.featureCache_[getUid(feature)] = {
|
this.featureCache_[getUid(feature)] = {
|
||||||
@@ -339,6 +340,14 @@ class WebGLPointsLayerRenderer extends WebGLLayerRenderer {
|
|||||||
this.featureCount_--;
|
this.featureCount_--;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @private
|
||||||
|
*/
|
||||||
|
handleSourceFeatureClear_() {
|
||||||
|
this.featureCache_ = {};
|
||||||
|
this.featureCount_ = 0;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user