Constructs a Geometry class and creates a geometry group in the process.
A reference to the map viewer
The default geometry group name
All added geometries
Creates a new circle.
The lon/lat coordinate of the circle
Optionaloptions: {Optional 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
The created circle feature
Creates a new marker icon.
The lon/lat position of the marker
Optionaloptions: {Optional marker 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
The created marker feature
Creates a new polygon.
The array of points to create the polygon
Optionaloptions: {Optional 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
The created polygon feature
Creates 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
The created polyline feature
Adds a new geometry to the group whose identifier is equal to geometryGroupId.
If geometryGroupId is not provided, uses the active geometry group. If the geometry group doesn't exist, creates it.
The geometry to be added to the group
OptionalgeometryGroupId: stringOptional id of the group to add the geometry to
Creates a new geometry group to manage multiple geometries at once.
The z-index is infinity by default, 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
The created or existing geometry group
Deletes a feature using the id and removes it from the groups and the map.
The id of the feature to delete
Finds the groups that the feature exists in and deletes the feature from those groups.
The geometry id
Deletes 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
Gets the active geometry group.
The active geometry group
Gets the coordinates of a specific feature.
The id of the feature
Optionalprojection: numberOptional projection code to transform the coordinates to. Otherwise, uses the map's projection by default
The coordinates of the feature, or undefined if not found or if the geometry type is not currently supported (e.g., GeometryCollection)
Finds a feature using its id.
The id of the feature to return
The feature having the specified id
Gets all geometry groups.
Array of all geometry groups
Finds the groups that contain the geometry using its id.
The id of the geometry
Groups that contain the geometry
Checks 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
Sets the active geometry group (the geometry group used when adding geometries).
If id is not specified, uses the default geometry group.
Optionalid: stringOptional id of the group to set as active
Allows for a feature's coordinates to be updated programmatically.
The id of the feature to update
The new coordinates for the feature
Optionalprojection: numberOptional projection code 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
True 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
True 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
True 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
True when the coordinates represent a Point
Class used to manage vector geometries (Polyline, Polygon, Circle, Marker...).