Add a method to scale geometries

This commit is contained in:
Tim Schaub
2016-08-04 10:23:00 -06:00
parent f50f1f401c
commit 795cee876e
8 changed files with 184 additions and 0 deletions

View File

@@ -180,6 +180,20 @@ ol.geom.Geometry.prototype.getExtent = function(opt_extent) {
ol.geom.Geometry.prototype.rotate = function(angle, anchor) {};
/**
* Scale the geometry (with an optional origin). This modifies the geometry
* coordinates in place.
* @abstract
* @param {number} sx The scaling factor in the x-direction.
* @param {number=} opt_sy The scaling factor in the y-direction (defaults to
* sx).
* @param {ol.Coordinate=} opt_anchor The scale origin (defaults to the center
* of the geometry extent).
* @api
*/
ol.geom.Geometry.prototype.scale = function(sx, opt_sy, opt_anchor) {};
/**
* Create a simplified version of this geometry. For linestrings, this uses
* the the {@link