Constructs a Geometry class and creates a geometry group in the process.
A reference to the map viewer
Create a new circle
The long lat coordinate of the circle
Optionaloptions: {The circle options including styling
OptionaloptionalFeatureId: stringOptional id to be used to manage this geometry
OptionalgroupId: stringOptional group id in which we want to add the geometry
a geometry containing the id and the created geometry
Create a new marker icon
The long lat position of the marker
Optionaloptions: {The marker options including styling
OptionaloptionalFeatureId: stringOptional id to be used to manage this geometry
OptionalgroupId: stringOptional group id in witch we want to add the geometry
a geometry containing the id and the created geometry
Create a new polygon
The array of points to create the polygon
Optionaloptions: {the polygon options including styling
OptionaloptionalFeatureId: stringOptional id to be used to manage this geometry
OptionalgroupId: stringOptional group id in which we want to add the geometry
a geometry containing the id and the created geometry
Create a polyline using an array of lon/lat points
The points of lon/lat to draw a polyline
Optionaloptions: {Optional polyline options including styling
Optionalid: stringOptional id to be used to manage this geometry
OptionalgroupId: stringOptional group id in which we want to add the geometry
a geometry containing the id and the created geometry
Add a new geometry to the group whose identifier is equal to geometryGroupId. if geometryGroupId is not provided, use the active geometry group. If the geometry group doesn't exist, create it.
The geometry to be added to the group
OptionalgeometryGroupId: stringOptional id of the group to add the geometry to
Create a new geometry group to manage multiple geometries at once (z-index is infinity, set the index to change the behaviour)
The id of the group to use when managing this group
Optionaloptions: {Optional vector layer and vector source options
created geometry group
Delete a feature using the id and delete it from the groups and the map
The id of the feature to delete
Find the groups that the feature exists in and delete the feature from those groups
The geometry id
Delete a geometry group and all the geometries from the map. The default geometry group can't be deleted.
The id of the geometry group to delete
Get the active geometry group
Get the coordinates of a specific feature
The id of the feature
Optionalprojection: numberOptional, transform the coordinates to the provided projection. Otherwise, uses the map's projection by default
Coordinates of the feature
Find a feature using it's id
The id of the feature to return
a feature having the specified id
Get all geometry groups
Array of all geometry groups
Find the groups that contain the geometry using it's id
The id of the geometry
Groups that contain the geometry
Check if a geometry group exists
The id of the geometry group to check
True if the group exists, false otherwise
Unregisters a geometry added event handler.
The callback to stop being called whenever the event is emitted
Registers a geometry added event handler.
The callback to be executed whenever the event is emitted
set the active geometry group (the geometry group used when adding geometries). If id is not specified, use the default geometry group.
Optionalid: stringOptional the id of the group to set as active
Allows for a feature's coordinates to be updated programatically.
The id of the feature to return
The new coordinates for the feature
Optionalprojection: numberOptional, the projection of the coordinates, assumes 4326 if not specified
StaticcreateCreates a Geometry given a geometry type and coordinates expected in any logical format.
The geometry type to create
The coordinates to use to create the geometry
The OpenLayers Geometry
StaticisTypeguards when a list of coordinates should actually be a single coordinate, such as a MultiPolygon.
The coordinates to check
when the coordinates represent a MultiPolygon
StaticisTypeguards when a list of coordinates should actually be a single coordinate, such as a MultiLineString or Polygon.
The coordinates to check
When the coordinates represent a MultiLineString or Polygon
StaticisTypeguards when a list of coordinates should actually be a single coordinate, such as a LineString.
The coordinates to check
When the coordinates represent a LineString
StaticisTypeguards when a list of coordinates should actually be a single coordinate, such as a Point.
The coordinates to check
When the coordinates represent a Point
Class used to manage vector geometries (Polyline, Polygon, Circle, Marker...)
Exports
GeometryApi