ol.geom. ol.geom.Polygon

new Polygon

Stability: experimental
Parameters:
Name Type Description
coordinates ol.geom.RawPolygon

Coordinates.

layout ol.geom.GeometryLayout | string

Layout.

Source:
  • polygon.js, line 29

Extends

Methods

<static> circular

Stability: experimental

Create an approximation of a circle on the surface of a sphere.

Parameters:
Name Type Argument Description
sphere ol.Sphere

The sphere.

center ol.Coordinate

Center.

radius number

Radius.

n number <optional>

Optional number of points. Default is 32.

Source:
  • polygon.js, line 328
Returns:

Circle geometry.

Type
ol.geom.Polygon

appendLinearRing

Stability: experimental
Parameters:
Name Type Description
linearRing ol.geom.LinearRing

Linear ring.

Source:
  • polygon.js, line 86

applyTransform

Stability: experimental

Apply a transform function to the geometry. Modifies the geometry in place.

Parameters:
Name Type Description
transformFn ol.TransformFunction

Transform.

Inherited From:
Source:
  • simplegeometry.js, line 246

clone

Stability: experimental
Source:
  • polygon.js, line 102
Returns:

Clone.

Type
ol.geom.Geometry

dispatchChangeEvent

Stability: experimental

Dispatches a change event. Register a listener for this event to get notified of changes.

Inherited From:
Source:
  • observable.js, line 39
Fires:
  • event:change

getArea

Stability: experimental
Source:
  • polygon.js, line 143
Returns:

Area.

Type
number

getClosestPoint

Stability: experimental
Parameters:
Name Type Argument Description
point ol.Coordinate

Point.

closestPoint ol.Coordinate <optional>

Closest point.

Inherited From:
Source:
  • geometry.js, line 112
Returns:

Closest point.

Type
ol.Coordinate

getCoordinates

Stability: experimental
Source:
  • polygon.js, line 153
Returns:

Coordinates.

Type
ol.geom.RawPolygon

getExtent

Stability: experimental

Get the extent of the geometry.

Parameters:
Name Type Argument Description
extent ol.Extent <optional>

Extent.

Inherited From:
Source:
  • simplegeometry.js, line 91
Returns:

extent Extent.

Type
ol.Extent

getFirstCoordinate

Stability: experimental
Inherited From:
Source:
  • simplegeometry.js, line 107
Returns:

First coordinate.

Type
ol.Coordinate

getInteriorPoint

Stability: experimental
Source:
  • polygon.js, line 186
Returns:

Interior point.

Type
ol.geom.Point

getLastCoordinate

Stability: experimental
Inherited From:
Source:
  • simplegeometry.js, line 124
Returns:

Last point.

Type
ol.Coordinate

getLayout

Stability: experimental
Inherited From:
Source:
  • simplegeometry.js, line 133
Returns:

Layout.

Type
ol.geom.GeometryLayout

getLinearRing

Stability: experimental
Parameters:
Name Type Description
index number

Index.

Source:
  • polygon.js, line 196
Returns:

Linear ring.

Type
ol.geom.LinearRing

getLinearRings

Stability: experimental
Source:
  • polygon.js, line 212
Returns:

Linear rings.

Type
Array.<ol.geom.LinearRing>

getSimplifiedGeometry

Stability: experimental
Parameters:
Name Type Description
squaredTolerance number

Squared tolerance.

Inherited From:
Source:
  • simplegeometry.js, line 142
Returns:

Simplified geometry.

Type
ol.geom.Geometry

getType

Stability: experimental
Source:
  • polygon.js, line 273
Returns:

Geometry type.

Type
ol.geom.GeometryType

on

Stability: experimental

Listen for a certain type of event.

Parameters:
Name Type Argument Description
type string | Array.<string>

The event type or array of event types.

listener function

The listener function.

this Object <optional>

The object to use as this in listener.

Inherited From:
Source:
  • observable.js, line 61
Returns:

Unique key for the listener.

Type
goog.events.Key

once

Stability: experimental

Listen once for a certain type of event.

Parameters:
Name Type Argument Description
type string | Array.<string>

The event type or array of event types.

listener function

The listener function.

this Object <optional>

The object to use as this in listener.

Inherited From:
Source:
  • observable.js, line 74
Returns:

Unique key for the listener.

Type
goog.events.Key

setCoordinates

Stability: experimental
Parameters:
Name Type Argument Description
coordinates ol.geom.RawPolygon

Coordinates.

layout ol.geom.GeometryLayout <optional>

Layout.

Source:
  • polygon.js, line 283

transform

Stability: experimental

Transform a geometry from one coordinate reference system to another. Modifies the geometry in place.

Parameters:
Name Type Description
source ol.proj.ProjectionLike

The current projection. Can be a string identifier or a ol.proj.Projection object.

destination ol.proj.ProjectionLike

The desired projection. Can be a string identifier or a ol.proj.Projection object.

Inherited From:
Source:
  • geometry.js, line 183
Returns:

This geometry. Note that original geometry is modified in place.

Type
ol.geom.Geometry

un

Stability: experimental

Unlisten for a certain type of event.

Parameters:
Name Type Argument Description
type string | Array.<string>

The event type or array of event types.

listener function

The listener function.

this Object <optional>

The object to use as this in listener.

Inherited From:
Source:
  • observable.js, line 86

unByKey

Stability: experimental

Removes an event listener using the key returned by on() or once().

Parameters:
Name Type Description
key goog.events.Key

Key.

Inherited From:
Source:
  • observable.js, line 96