/**
 * @fileoverview Drag Handler.
 *
 * A drag handler uses a goog.fx.Dragger object to receive dragstart, drag, dragend
 * events for a DOM element, and re-dispatches these events to the map.
 *
 */

goog.provide('ol.handler.Drag');

goog.require('goog.fx.Dragger');
goog.require('goog.events');
goog.require('goog.Disposable');

/**
 * @constructor
 * @extends {goog.Disposable}
 * @param {ol.Map} map The map instance.
 * @param {Element} elt The element that will be dragged.
 */
ol.handler.Drag = function(map, elt) {

    var dragger = new goog.fx.Dragger(elt);
    this.registerDisposable(dragger);

    dragger.defaultAction = function() {};

    var prevX = 0, prevY = 0;

    var handleDragStart = function(e) {
        prevX = e.clientX;
        prevY = e.clientY;
        var newE = {
            type: 'dragstart'
        };
        goog.events.dispatchEvent(map, newE);
    };

    var handleDrag = function(e) {
        var newE = {
            type: 'drag',
            deltaX: e.clientX - prevX,
            deltaY: e.clientY - prevY
        };
        prevX = e.clientX;
        prevY = e.clientY;
        goog.events.dispatchEvent(map, newE);
    };

    var handleDragEnd = function(e) {
        var newE = {
            type: 'dragend'
        };
        goog.events.dispatchEvent(map, newE);
    };

    goog.events.listen(dragger, goog.fx.Dragger.EventType.START,
                       handleDragStart, false, this);
    goog.events.listen(dragger, goog.fx.Dragger.EventType.DRAG,
                       handleDrag, false, this);
    goog.events.listen(dragger, goog.fx.Dragger.EventType.END,
                       handleDragEnd, false, this);
};
goog.inherits(ol.handler.Drag, goog.Disposable);

@@ -287,24 +287,63 @@
 g.events');%0A
+goog.require('goog.events.EventType');%0A
 goog.require
@@ -1706,56 +1706,514 @@
 s);%0A
-%7D;%0Agoog.inherits(ol.handler.Drag, goog.Disposable)
+%0A%0A    // prevent page scrolling%0A    this.moveListenerKey_ = goog.events.listen(%0A                                elt,%0A                                %5Bgoog.events.EventType.TOUCHMOVE,%0A                                 goog.events.EventType.MOUSEMOVE%5D,%0A                                function(e) %7B e.preventDefault(); %7D);%0A%7D;%0Agoog.inherits(ol.handler.Drag, goog.Disposable);%0A%0A/**%0A * @inheritDoc%0A */%0Aol.handler.Drag.prototype.disposeInternal = function() %7B%0A    goog.events.unlistenByKey(this.moveListenerKey_);%0A%7D
 ;%0A

make the drag handler prevent page scrolling