Fire a moveend event after rendering
The moveend event is fired after rendering if there is no pending animation, current interaction, or other pre-render functions in the queue.
This commit is contained in:
@@ -979,6 +979,15 @@ ol.Map.prototype.renderFrame_ = function(time) {
|
|||||||
}
|
}
|
||||||
Array.prototype.push.apply(
|
Array.prototype.push.apply(
|
||||||
this.postRenderFunctions_, frameState.postRenderFunctions);
|
this.postRenderFunctions_, frameState.postRenderFunctions);
|
||||||
|
|
||||||
|
var idle = this.preRenderFunctions_.length == 0 &&
|
||||||
|
!frameState.animate &&
|
||||||
|
!frameState.viewHints[ol.ViewHint.ANIMATING] &&
|
||||||
|
!frameState.viewHints[ol.ViewHint.INTERACTING];
|
||||||
|
|
||||||
|
if (idle) {
|
||||||
|
this.dispatchEvent(new ol.MapEvent(ol.MapEventType.MOVEEND, this));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.dispatchEvent(
|
this.dispatchEvent(
|
||||||
|
|||||||
+2
-1
@@ -9,7 +9,8 @@ goog.require('ol.FrameState');
|
|||||||
* @enum {string}
|
* @enum {string}
|
||||||
*/
|
*/
|
||||||
ol.MapEventType = {
|
ol.MapEventType = {
|
||||||
POSTRENDER: 'postrender'
|
POSTRENDER: 'postrender',
|
||||||
|
MOVEEND: 'moveend'
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user