Add view abstraction
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
// FIXME works for View2D only
|
||||
|
||||
goog.provide('ol.interaction.DblClickZoom');
|
||||
|
||||
goog.require('ol.MapBrowserEvent');
|
||||
goog.require('ol.MapBrowserEvent.EventType');
|
||||
goog.require('ol.View2D');
|
||||
goog.require('ol.interaction.Interaction');
|
||||
|
||||
|
||||
@@ -35,7 +38,10 @@ ol.interaction.DblClickZoom.prototype.handleMapBrowserEvent =
|
||||
var anchor = mapBrowserEvent.getCoordinate();
|
||||
var delta = mapBrowserEvent.browserEvent.shiftKey ?
|
||||
-this.delta_ : this.delta_;
|
||||
map.zoom(delta, anchor);
|
||||
// FIXME works for View2D only
|
||||
var view = map.getView();
|
||||
goog.asserts.assert(view instanceof ol.View2D);
|
||||
view.zoom(map, delta, anchor);
|
||||
mapBrowserEvent.preventDefault();
|
||||
browserEvent.preventDefault();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user