OpenLayers OpenLayers

Ticket #1326: Vector.js.diff

File Vector.js.diff, 0.9 kB (added by sbenthall, 7 months ago)

Patch for Vector.js

  • Vector.js

    old new  
    210214        // pass 
    211215    }, 
    212216     
     217    move: function(location) { 
     218         
     219        var pixel; 
     220        if (location.CLASS_NAME == "OpenLayers.LonLat") { 
     221            pixel = this.layer.getViewPortPxFromLonLat(location); 
     222        } else { 
     223            pixel = location; 
     224        } 
     225         
     226        var lastPixel = this.layer.getViewPortPxFromLonLat(this.geometry.getBounds().getCenterLonLat()); 
     227        var res = this.layer.map.getResolution(); 
     228        this.geometry.move(res * (pixel.x - lastPixel.x), 
     229                           res * (lastPixel.y - pixel.y)); 
     230        this.layer.drawFeature(this); 
     231        return lastPixel; 
     232    }, 
     233     
    213234    /** 
    214235     * Method: toState 
    215236     * Sets the new state