JS API
- Parameters
- Options
- Example
- Methods
- fitToBoundingBox
- getBoundingBox
- getInitialBoundingBox
- getLayers
- getMouseMode
- off
- on
- once
- refresh
- reset
- setMouseMode
- usingLayer
- usingNewLayer
- Events
- Parameters
- Example
- Methods
- addFeature
- addFeatureCollection
- bringForwards
- bufferGeometry
- changeProperties
- clearFilters
- clearFeatures
- clearStyle
- clipByFeatureCollection
- convertToCentroids
- filterByBoundingBox
- filterByFeatureCollection
- filterByNearest
- filterByText
- getFeatureCollection
- hide
- sendBackwards
- show
- style
- update
- usingFeature
getCentroid
Calculates the centroid of a GeoJSON geometry object or BoundingBox as a GeoJSON Point.
Parameters
Name | Required | Description |
---|---|---|
geometry | Yes | Any GeoJSON Point, MultiPoint, LineString, MultiLineString, Polygon or MultiPolygon object or a BoundingBox array. |