rely on registerDisposable

This commit is contained in:
Éric Lemoine
2012-07-02 17:33:01 +02:00
parent 946cd33350
commit 410d79faa1
2 changed files with 9 additions and 14 deletions
+2 -9
View File
@@ -108,13 +108,6 @@ ol.Map = function() {
* @type {Element}
*/
this.container_ = null;
/**
* @private
* @type {ol.handler.Drag}
*/
this.dragHandler_ = null;
};
goog.inherits(ol.Map, goog.events.EventTarget);
@@ -472,7 +465,8 @@ ol.Map.prototype.setViewport = function() {
'class': 'ol-viewport',
'style': 'width:100%;height:100%;top:0;left:0;position:relative;overflow:hidden'
}));
this.dragHandler_ = new ol.handler.Drag(this, this.viewport_);
var dragHandler = new ol.handler.Drag(this, this.viewport_);
this.registerDisposable(dragHandler);
}
goog.dom.appendChild(this.container_, this.viewport_);
};
@@ -545,7 +539,6 @@ ol.Map.prototype.disposeInternal = function() {
for (var key in this) {
delete this[key];
}
this.dragHandler_.dispose();
};