OpenLayers OpenLayers

Ticket #1037: geometry.patch

File geometry.patch, 2.7 kB (added by crschmidt, 1 year ago)
  • lib/OpenLayers/Geometry/Point.js

    old new  
    168168        this.y = origin.y + (scale * (this.y - origin.y)); 
    169169        this.clearBounds(); 
    170170    }, 
     171     
     172    /** 
     173     * APIMethod: transform 
     174     * Translate the x,y properties of the point from source to dest. 
     175     *  
     176     * Parameters: 
     177     * source - {<OpenLayers.Projection>}  
     178     * dest - {<OpenLayers.Projection>} 
     179     *  
     180     * Returns: 
     181     * {<OpenLayers.Geometry>}  
     182     */ 
     183    transform: function(source, dest) { 
     184        if ((source && dest)) { 
     185            OpenLayers.Projection.transform( 
     186                this, source, dest);  
     187        }        
     188        return this; 
     189    }, 
    171190 
    172191    CLASS_NAME: "OpenLayers.Geometry.Point" 
    173192}); 
  • lib/OpenLayers/Geometry/LinearRing.js

    old new  
    174174        } 
    175175        return area; 
    176176    }, 
     177     
     178    /** 
     179     * APIMethod: transform 
     180     * Reproject the components geometry from source to dest. 
     181     * 
     182     * Parameters: 
     183     * source - {<OpenLayers.Projection>} 
     184     * dest - {<OpenLayers.Projection>} 
     185     *  
     186     * Returns: 
     187     * {<OpenLayers.Geometry>}  
     188     */ 
     189    transform: function(source, dest) { 
     190        if (source && dest) { 
     191            for (var i = 0; i < this.components.length - 1; i++) { 
     192                var component = this.components[i]; 
     193                    component.transform(source, dest); 
     194            } 
     195        } 
     196        return this; 
     197    }, 
    177198 
    178199    CLASS_NAME: "OpenLayers.Geometry.LinearRing" 
    179200}); 
  • lib/OpenLayers/Geometry/Collection.js

    old new  
    306306        return equivalent; 
    307307    }, 
    308308 
     309    /** 
     310     * APIMethod: transform 
     311     * Reproject the components geometry from source to dest. 
     312     *  
     313     * Parameters: 
     314     * source - {<OpenLayers.Projection>}  
     315     * dest - {<OpenLayers.Projection>} 
     316     *  
     317     * Returns: 
     318     * {<OpenLayers.Geometry>}  
     319     */ 
     320    transform: function(source, dest) { 
     321        if (source && dest) { 
     322            for (var i = 0; i < this.components.length; i++) {   
     323                var component = this.components[i]; 
     324                    component.transform(source, dest); 
     325            } 
     326        }    
     327        return this; 
     328    }, 
     329 
    309330    CLASS_NAME: "OpenLayers.Geometry.Collection" 
    310331});