Add view abstraction

This commit is contained in:
Éric Lemoine
2013-01-04 17:07:20 +01:00
parent 21331d1065
commit 927cffb2b7
34 changed files with 934 additions and 690 deletions
@@ -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();
}