OpenLayers OpenLayers

Ticket #1125: alternativeSmoothDrag.diff

File alternativeSmoothDrag.diff, 0.8 kB (added by ahocevar, 10 months ago)

Alternative to the original patch, delaying the move function in OpenLayers.Handler.Drag

  • /mnt/d/eclipse/workspace/openlayers/lib/OpenLayers/Handler/Drag.js

    old new  
    185185        if (this.started) { 
    186186            if(evt.xy.x != this.last.x || evt.xy.y != this.last.y) { 
    187187                this.dragging = true; 
    188                 this.move(evt); 
     188                window.clearTimeout(this.moveTimer); 
     189                this.moveTimer = window.setTimeout(OpenLayers.Function.bind( 
     190                        function(){this.move(evt);}, this), 50); 
    189191                this.callback("move", [evt.xy]); 
    190192                if(!this.oldOnselectstart) { 
    191193                    this.oldOnselectstart = document.onselectstart;