Merge pull request #982 from tschaub/moveend

Fire a moveend event when the view settles.
This commit is contained in:
Tim Schaub
2013-09-10 16:36:31 -07:00
4 changed files with 115 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(