Cancel postrender before disposing renderer
This commit is contained in:
@@ -166,6 +166,12 @@ class PluggableMap extends BaseObject {
|
|||||||
this.pixelRatio_ = options.pixelRatio !== undefined ?
|
this.pixelRatio_ = options.pixelRatio !== undefined ?
|
||||||
options.pixelRatio : DEVICE_PIXEL_RATIO;
|
options.pixelRatio : DEVICE_PIXEL_RATIO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @private
|
||||||
|
* @type {*}
|
||||||
|
*/
|
||||||
|
this.postRenderTimeoutHandle_;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {number|undefined}
|
* @type {number|undefined}
|
||||||
@@ -1022,6 +1028,8 @@ class PluggableMap extends BaseObject {
|
|||||||
|
|
||||||
if (!targetElement) {
|
if (!targetElement) {
|
||||||
if (this.renderer_) {
|
if (this.renderer_) {
|
||||||
|
clearTimeout(this.postRenderTimeoutHandle_);
|
||||||
|
this.postRenderFunctions_.length = 0;
|
||||||
this.renderer_.dispose();
|
this.renderer_.dispose();
|
||||||
this.renderer_ = null;
|
this.renderer_ = null;
|
||||||
}
|
}
|
||||||
@@ -1284,7 +1292,7 @@ class PluggableMap extends BaseObject {
|
|||||||
|
|
||||||
this.dispatchEvent(new MapEvent(MapEventType.POSTRENDER, this, frameState));
|
this.dispatchEvent(new MapEvent(MapEventType.POSTRENDER, this, frameState));
|
||||||
|
|
||||||
setTimeout(this.handlePostRender.bind(this), 0);
|
this.postRenderTimeoutHandle_ = setTimeout(this.handlePostRender.bind(this), 0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user