Fix drag pan for rotated maps
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
// FIXME cope with rotation
|
||||
|
||||
goog.provide('ol.interaction.DragPan');
|
||||
|
||||
goog.require('ol.Coordinate');
|
||||
@@ -26,8 +24,12 @@ goog.inherits(ol.interaction.DragPan, ol.interaction.Drag);
|
||||
ol.interaction.DragPan.prototype.handleDrag = function(mapBrowserEvent) {
|
||||
var map = mapBrowserEvent.map;
|
||||
var resolution = map.getResolution();
|
||||
var rotation = map.getRotation();
|
||||
var delta =
|
||||
new ol.Coordinate(-resolution * this.deltaX, resolution * this.deltaY);
|
||||
if (map.canRotate() && goog.isDef(rotation)) {
|
||||
delta.rotate(rotation);
|
||||
}
|
||||
this.pan(map, delta, this.startCenter);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user