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

View File

@@ -89,6 +89,7 @@ ol.interaction.Drag.prototype.handleMapBrowserEvent =
if (!map.isDef()) {
return;
}
var view = map.getView();
var browserEvent = mapBrowserEvent.browserEvent;
if (this.dragging_) {
if (mapBrowserEvent.type == ol.MapBrowserEvent.EventType.DRAG) {
@@ -109,7 +110,7 @@ ol.interaction.Drag.prototype.handleMapBrowserEvent =
this.startY = browserEvent.clientY;
this.deltaX = 0;
this.deltaY = 0;
this.startCenter = /** @type {!ol.Coordinate} */ map.getCenter();
this.startCenter = /** @type {!ol.Coordinate} */ (view.getCenter());
this.startCoordinate = /** @type {ol.Coordinate} */
(mapBrowserEvent.getCoordinate());
var handled = this.handleDragStart(mapBrowserEvent);