new Geometry()
Methods
-
Return the closest point of the geometry to the passed point as
coordinate.Name Type Description pointmodule:ol/coordinate~Coordinate Point.
closestPointmodule:ol/coordinate~Coordinate Closest point.
Returns:
Closest point.
-
Get the extent of the geometry.
Name Type Description extentmodule:ol/extent~Extent Extent.
Returns:
extent Extent.
-
intersectsCoordinate(coordinate){boolean}
geom/Geometry.js, line 106 -
Returns true if this geometry includes the specified coordinate. If the coordinate is on the boundary of the geometry, returns false.
Name Type Description coordinatemodule:ol/coordinate~Coordinate Coordinate.
Returns:
Contains coordinate.
-
rotate(angle, anchor)
geom/Geometry.js, line 140 -
Rotate the geometry around a given coordinate. This modifies the geometry coordinates in place.
Name Type Description anglenumber Rotation angle in radians.
anchormodule:ol/coordinate~Coordinate The rotation center.
-
scale(sx, opt_sy, opt_anchor)
geom/Geometry.js, line 153 -
Scale the geometry (with an optional origin). This modifies the geometry coordinates in place.
Name Type Description sxnumber The scaling factor in the x-direction.
synumber The scaling factor in the y-direction (defaults to sx).
anchormodule:ol/coordinate~Coordinate The scale origin (defaults to the center of the geometry extent).
-
Create a simplified version of this geometry. For linestrings, this uses the the Douglas Peucker algorithm. For polygons, a quantization-based simplification is used to preserve topology.
Name Type Description tolerancenumber The tolerance distance for simplification.
Returns:
A new, simplified version of the original geometry.
-
Transform each coordinate of the geometry from one coordinate reference system to another. The geometry is modified in place. For example, a line will be transformed to a line and a circle to a circle. If you do not want the geometry modified in place, first
clone()it and then use this function on the clone.Name Type Description sourcemodule:ol/proj~ProjectionLike The current projection. Can be a string identifier or a
module:ol/proj/Projection~Projectionobject.destinationmodule:ol/proj~ProjectionLike The desired projection. Can be a string identifier or a
module:ol/proj/Projection~Projectionobject.Returns:
This geometry. Note that original geometry is modified in place.
-
translate(deltaX, deltaY)
geom/Geometry.js, line 162 -
Translate the geometry. This modifies the geometry coordinates in place.
Name Type Description deltaXnumber Delta X.
deltaYnumber Delta Y.
OpenLayers