No need to pass the element to the constructor.

If MapHandler subclasses could live without a map, it would make sense to have a constructor with a target and an element. But because the target is always the map, and the handler need to know about the map for performing default behavior, we always assume the map's viewport as element.
This commit is contained in:
ahocevar
2012-07-12 20:44:32 +02:00
parent f672303f0a
commit 42c4c9d869
5 changed files with 17 additions and 17 deletions
+3 -3
View File
@@ -528,15 +528,15 @@ ol.Map.prototype.initHandlers = function() {
states = /** @type {ol.handler.states} */ ({});
if (ol.ENABLE_DRAG_HANDLER) {
handler = new ol.handler.Drag(this, this.viewport_, states);
handler = new ol.handler.Drag(this, states);
this.registerDisposable(handler);
}
if (ol.ENABLE_MOUSEWHEEL_HANDLER) {
handler = new ol.handler.MouseWheel(this, this.viewport_, states);
handler = new ol.handler.MouseWheel(this, states);
this.registerDisposable(handler);
}
if (ol.ENABLE_CLICK_HANDLER) {
handler = new ol.handler.Click(this, this.viewport_, states);
handler = new ol.handler.Click(this, states);
this.registerDisposable(handler);
}
};