#807 - give geometries a resize method - examples and tests for demonstration

git-svn-id: http://svn.openlayers.org/trunk/openlayers@3631 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Tim Schaub
2007-07-06 20:32:22 +00:00
parent 0d596fbb03
commit c2fcb22d98
5 changed files with 141 additions and 0 deletions

View File

@@ -260,6 +260,24 @@ OpenLayers.Geometry.Collection.prototype =
}
},
/**
* APIMethod: resize
* Resize a geometry relative to some origin. Use this method to apply
* a uniform scaling to a geometry.
*
* Parameters:
* scale - {Float} Factor by which to scale the geometry. A scale of 2
* doubles the size of the geometry in each dimension
* (lines, for example, will be twice as long, and polygons
* will have four times the area).
* origin - {OpenLayers.Geometry.Point} Point of origin for resizing
*/
resize: function(scale, origin) {
for(var i=0; i<this.components.length; ++i) {
this.components[i].resize(scale, origin);
}
},
/**
* APIMethod: equals
* Tests for equivalent geometries