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:
Tim Schaub
2013-09-05 14:56:14 -06:00
parent cd11ebbc8a
commit 50ed564bf6
2 changed files with 11 additions and 1 deletions

View File

@@ -979,6 +979,15 @@ ol.Map.prototype.renderFrame_ = function(time) {
}
Array.prototype.push.apply(
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(