OpenLayers OpenLayers

Changeset 3993

Show
Ignore:
Timestamp:
08/23/07 12:05:51 (1 year ago)
Author:
fredj
Message:

use move() instead of setting geometry xy 'by hand'

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • sandbox/camptocamp/feature/lib/OpenLayers/Control/DragFeature.js

    r3989 r3993  
    204204     */ 
    205205    moveFeature: function(pixel) { 
    206         var lonlat = this.snappingHandler.getPoint(this.map.getLonLatFromPixel(pixel)); 
    207         this.feature.geometry.x = lonlat.lon; 
    208         this.feature.geometry.y = lonlat.lat; 
    209         this.feature.geometry.clearBounds(); 
     206        var snapped = this.snappingHandler.getPoint(this.map.getLonLatFromPixel(pixel)); 
     207        this.feature.geometry.move(snapped.lon - this.feature.geometry.x,  
     208                                   snapped.lat - this.feature.geometry.y); 
    210209 
    211210        this.layer.drawFeature(this.feature); 
  • sandbox/camptocamp/feature/lib/OpenLayers/Geometry/Point.js

    r3935 r3993  
    141141        this.x = this.x + x; 
    142142        this.y = this.y + y; 
     143        this.clearBounds(); 
    143144    }, 
    144145 
     
    157158        this.x = origin.x + (radius * Math.cos(theta)); 
    158159        this.y = origin.y + (radius * Math.sin(theta)); 
     160        this.clearBounds(); 
    159161    }, 
    160162 
     
    174176        this.x = origin.x + (scale * (this.x - origin.x)); 
    175177        this.y = origin.y + (scale * (this.y - origin.y)); 
     178        this.clearBounds(); 
    176179    }, 
    177180 
  • sandbox/camptocamp/feature/lib/OpenLayers/Handler/Path.js

    r3979 r3993  
    186186             
    187187            var snapped = this.snappingHandler.getPoint(this.map.getLonLatFromPixel(evt.xy)); 
    188             this.point.geometry.x = snapped.lon; 
    189             this.point.geometry.y = snapped.lat
     188            this.point.geometry.move(snapped.lon - this.point.geometry.x,  
     189                                     snapped.lat - this.point.geometry.y)
    190190 
    191191            if(this.mouseDown && this.freehandMode(evt)) {