Merge pull request #117 from twpayne/postrender-event
Fire postrender events
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
// FIXME add tilt and height?
|
||||
|
||||
goog.provide('ol.Map');
|
||||
goog.provide('ol.MapEventType');
|
||||
goog.provide('ol.MapProperty');
|
||||
goog.provide('ol.RendererHint');
|
||||
goog.provide('ol.RendererHints');
|
||||
@@ -665,6 +664,9 @@ ol.Map.prototype.renderFrame_ = function(time) {
|
||||
this.frameState_ = frameState;
|
||||
this.dirty_ = false;
|
||||
|
||||
this.dispatchEvent(
|
||||
new ol.MapEvent(ol.MapEventType.POSTRENDER, this, frameState));
|
||||
|
||||
goog.global.setTimeout(this.handlePostRender_, 0);
|
||||
|
||||
};
|
||||
|
||||
@@ -1,6 +1,16 @@
|
||||
goog.provide('ol.MapEvent');
|
||||
goog.provide('ol.MapEventType');
|
||||
|
||||
goog.require('goog.events.Event');
|
||||
goog.require('ol.FrameState');
|
||||
|
||||
|
||||
/**
|
||||
* @enum {string}
|
||||
*/
|
||||
ol.MapEventType = {
|
||||
POSTRENDER: 'postrender'
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -9,8 +19,9 @@ goog.require('goog.events.Event');
|
||||
* @extends {goog.events.Event}
|
||||
* @param {string} type Event type.
|
||||
* @param {ol.Map} map Map.
|
||||
* @param {?ol.FrameState=} opt_frameState Frame state.
|
||||
*/
|
||||
ol.MapEvent = function(type, map) {
|
||||
ol.MapEvent = function(type, map, opt_frameState) {
|
||||
|
||||
goog.base(this, type);
|
||||
|
||||
@@ -24,6 +35,11 @@ ol.MapEvent = function(type, map) {
|
||||
*/
|
||||
this.defaultPrevented = false;
|
||||
|
||||
/**
|
||||
* @type {?ol.FrameState}
|
||||
*/
|
||||
this.frameState = goog.isDef(opt_frameState) ? opt_frameState : null;
|
||||
|
||||
};
|
||||
goog.inherits(ol.MapEvent, goog.events.Event);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user