getCoordinatesFromGeometry
getCoordinatesFromGeometry(
g):Coordinate[]
Defined in: src/geometry.ts:58
Extracts all coordinates from a geometry object, flattening nested structures. Handles geometry collections and all geometry types, returning a flat array of coordinates.
Parameters
Section titled “Parameters”Geometry
The OpenLayers geometry to extract coordinates from
Returns
Section titled “Returns”Coordinate[]
Flat array of coordinate arrays
Example
Section titled “Example”const line = new LineString([[0,0], [1,1], [2,2]])const coords = getCoordinatesFromGeometry(line) // Returns [[0,0], [1,1], [2,2]]