toJSON
Converts the geometry to a GeoJSON Feature object.
This method allows the geometry to be serialized to JSON
and is automatically called by JSON.stringify().
geom.toJSON() is equivalent of calling
toGeoJSON(geom, { flavor: 'extended', layout: 'XYZM' })
Returns
JSON_Feature<JSON_Geometry, P>
A GeoJSON Feature representation of this geometry
See also
toGeoJSONconverts geometry to a GeoJSONFeatureor a GeoJSONFeatureCollectionobject.