Class: MultiGeometry
- Last UpdatedMay 21, 2025
- 2 minute read
The base class for a geometry that is a container for multiple geometries of a generic type.
The type of the contained geometries is specified by the generic type parameter T
.
Name | Type | Description |
---|---|---|
geometries |
Array.<!T> |
The list of geometries which are initially aggregated. |
Throws:
-
if
geometries
parameter is not valid
Extends
Methods
-
Checks whether the geometry is equal to the geometry supplied by the caller. Two geometries are considered as equal if they represent the same geometry type and have equal coordinate values.
Name Type Description other
* The geometry to check against
Returns:
Type Description boolean true
if the two geometries are equal, otherwisefalse
-
getBoundingBox ()H.geo.Rect inherited overrides
-
Returns the bounding rectangle of the geometry.
Returns:
Type Description H.geo.Rect the bounding rectangle of the geometry or null
if the bounding rectangle can't be computed (e.g. for a geometry without coordinates) -
Returns the aggregated geometries of the multi-geometry. The returned geometries must be treated as read-only to not violate the integrity of the multi-geometry.
Returns:
Type Description Array.<!T> An array of geometries -
Adds the specified geometry to the current multi-geometry.
Name Type Description geometry
T A geometry which will be added to the current multi-geometry
Throws:
-
in case of invalid
geometry
argument
-
-
Removes the specified geometry from the multi-geometry.
Name Type Description geometry
T The geometry (by reference) to remove from this multi-geometry.
Returns:
Type Description T the removed geometry or null
if the geometry was not found -
Removes a contained geometry at the given index.
Name Type Description index
number The index of the geometry to remove.
Throws:
-
if no geometry exists at the given index.
Returns:
Type Description T the removed geometry. -
-
This method splices the specified MultiGeometry at the provided index, removing the specified number of items at that index and inserting new items.
Returns:
Type Description Array.<!T> the removed geometries. -
toGeoJSON ()Object inherited
-
To obtain a GeoJSON representation of the given geometry.
Returns:
Type Description Object A GeoJSON Geometry object representing the given geometry. -
toString () inherited
-
To obtain a Well-Known-Text (WKT) representation of the geometry.