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:
+3
-3
@@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user