OpenLayers OpenLayers

Ticket #1506: Drag_1056.patch

File Drag_1056.patch, 3.0 kB (added by avlee, 8 months ago)
  • Control/DragPan.js

    old new  
    3434     * <panMapDone> as callbacks. 
    3535     */     
    3636    draw: function() { 
    37         this.handler = new OpenLayers.Handler.Drag(this, 
    38                             {"move": this.panMap, "done": this.panMapDone}); 
     37        var callbacks = { 
     38            "down": this.startPan,  
     39            "move": this.panMap,  
     40            "out":  this.endPan, 
     41            "up":   this.endPan, 
     42            "done": this.panMapDone 
     43        }; 
     44        this.handler = new OpenLayers.Handler.Drag(this, callbacks); 
    3945    }, 
    4046 
    4147    /** 
     
    6773            this.panned = false; 
    6874        } 
    6975    }, 
     76     
     77    startPan: function(xy) { 
     78        // TBD replace with CSS classes 
     79        this.map.div.style.cursor = "move"; 
     80    }, 
     81     
     82    endPan: function() { 
     83        // TBD replace with CSS classes 
     84        this.map.div.style.cursor = ""; 
     85    }, 
    7086 
    7187    CLASS_NAME: "OpenLayers.Control.DragPan" 
    7288}); 
  • Handler/Drag.js

    old new  
    160160            this.started = true; 
    161161            this.start = evt.xy; 
    162162            this.last = evt.xy; 
    163             // TBD replace with CSS classes 
    164             this.map.div.style.cursor = "move"; 
    165163            this.down(evt); 
    166164            this.callback("down", [evt.xy]); 
    167165            OpenLayers.Event.stop(evt); 
     
    221219            var dragged = (this.start != this.last); 
    222220            this.started = false; 
    223221            this.dragging = false; 
    224             // TBD replace with CSS classes 
    225             this.map.div.style.cursor = ""; 
    226222            this.up(evt); 
    227223            this.callback("up", [evt.xy]); 
    228224            if(dragged) { 
     
    248244            var dragged = (this.start != this.last); 
    249245            this.started = false;  
    250246            this.dragging = false; 
    251             // TBD replace with CSS classes 
    252             this.map.div.style.cursor = ""; 
    253247            this.out(evt); 
    254248            this.callback("out", []); 
    255249            if(dragged) { 
  • Handler/RegularPolygon.js

    old new  
    255255            this.feature.geometry.resize(1, this.origin, ratio); 
    256256            this.feature.geometry.move(dx / 2, dy / 2); 
    257257        } 
     258        // TBD replace with CSS classes 
     259        this.map.div.style.cursor = "move"; 
    258260        this.layer.drawFeature(this.feature, this.style); 
    259261    }, 
    260262 
     
    351353     * Finish the geometry and call the "done" callback. 
    352354     */ 
    353355    finalize: function() { 
     356        // TBD replace with CSS classes 
     357        this.map.div.style.cursor = ""; 
    354358        this.origin = null; 
    355359        this.radius = this.options.radius; 
    356360    },