goog.provide('ol.control.DragPan');

goog.require('ol.MapBrowserEvent');
goog.require('ol.control.Drag');



/**
 * @constructor
 * @extends {ol.control.Drag}
 */
ol.control.DragPan = function() {
  goog.base(this);
};
goog.inherits(ol.control.DragPan, ol.control.Drag);


/**
 * @inheritDoc
 */
ol.control.DragPan.prototype.handleDrag = function(event) {
  window.console.log(
      'drag delta (' + this.deltaX + ', ' + this.deltaY + ')');
};


/**
 * @inheritDoc
 */
ol.control.DragPan.prototype.handleDragEnd = function(event) {
  window.console.log(
      'drag end at delta (' + this.deltaX + ', ' + this.deltaY + ')');
};


/**
 * @inheritDoc
 */
ol.control.DragPan.prototype.handleDragStart = function(event) {
  var browserEventObject = event.getBrowserEventObject();
  if (browserEventObject.shiftKey) {
    window.console.log('not starting drag while shift key is pressed');
    return false;
  } else {
    window.console.log(
        'drag start at (' + this.startX + ', ' + this.startY + ')');
    return true;
  }
};

@@ -30,16 +30,86 @@
 Pan');%0A%0A
+goog.require('goog.functions');%0Agoog.require('goog.math.Coordinate');%0A
 goog.req
@@ -425,678 +425,334 @@
 %7B%0A  
-window.console.log(%0A      'drag delta (' + this.deltaX + ', ' + this.deltaY + ')');%0A%7D;%0A%0A%0A/**%0A * @inheritDoc%0A */%0Aol.control.DragPan.prototype.handleDragEnd = function(event) %7B%0A  window.console.log(%0A      'drag end at delta (' + this.deltaX + ', ' + this.deltaY + ')');%0A%7D;%0A%0A%0A/**%0A * @inheritDoc%0A */%0Aol.control.DragPan.prototype.handleDragStart = function(event) %7B%0A  var browserEventObject = event.getBrowserEventObject();%0A  if (browserEventObject.shiftKey) %7B%0A    window.console.log('not starting drag while shift key is pressed');%0A    return false;%0A  %7D else %7B%0A    window.console.log(%0A        'drag start at (' + this.startX + ', ' + this.startY + ')');%0A    return true;%0A  %7D%0A%7D
+var map = event.map;%0A  var resolution = map.getResolution();%0A  var center = new goog.math.Coordinate(%0A      this.startCenter.x - resolution * this.deltaX,%0A      this.startCenter.y + resolution * this.deltaY);%0A  map.setCenter(center);%0A%7D;%0A%0A%0A/**%0A * @inheritDoc%0A */%0Aol.control.DragPan.prototype.handleDragStart = goog.functions.TRUE
 ;%0A

Implement ol.control.DragPan