Render on view changes
This commit is contained in:
@@ -216,6 +216,12 @@ ol.Map = function(options) {
|
||||
*/
|
||||
this.viewPropertyListenerKey_ = null;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {?ol.EventsKey}
|
||||
*/
|
||||
this.viewChangeListenerKey_ = null;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Array.<ol.EventsKey>}
|
||||
@@ -1102,11 +1108,18 @@ ol.Map.prototype.handleViewChanged_ = function() {
|
||||
ol.events.unlistenByKey(this.viewPropertyListenerKey_);
|
||||
this.viewPropertyListenerKey_ = null;
|
||||
}
|
||||
if (this.viewChangeListenerKey_) {
|
||||
ol.events.unlistenByKey(this.viewChangeListenerKey_);
|
||||
this.viewChangeListenerKey_ = null;
|
||||
}
|
||||
var view = this.getView();
|
||||
if (view) {
|
||||
this.viewPropertyListenerKey_ = ol.events.listen(
|
||||
view, ol.ObjectEventType.PROPERTYCHANGE,
|
||||
this.handleViewPropertyChanged_, this);
|
||||
this.viewChangeListenerKey_ = ol.events.listen(
|
||||
view, ol.events.EventType.CHANGE,
|
||||
this.handleViewPropertyChanged_, this);
|
||||
}
|
||||
this.render();
|
||||
};
|
||||
@@ -1221,7 +1234,6 @@ ol.Map.prototype.removeOverlay = function(overlay) {
|
||||
* @private
|
||||
*/
|
||||
ol.Map.prototype.renderFrame_ = function(time) {
|
||||
|
||||
var i, ii, viewState;
|
||||
|
||||
var size = this.getSize();
|
||||
|
||||
Reference in New Issue
Block a user