Generate a standard GeoJSON Feature string from coordinate buffer and geometry type.
coords
Float64Array
[lng0, lat0, lng1, lat1, …]
geometry_type
"Point"
"LineString"
"Polygon"
"MultiPoint"
A JSON string representing a GeoJSON Feature.
const coords = new Float64Array([116.404, 39.915]);const json = core.geoJsonFromCoords(coords, "Point");// json = '{"type":"Feature","geometry":{"type":"Point","coordinates":[116.404,39.915]},"properties":{}}' Copy
const coords = new Float64Array([116.404, 39.915]);const json = core.geoJsonFromCoords(coords, "Point");// json = '{"type":"Feature","geometry":{"type":"Point","coordinates":[116.404,39.915]},"properties":{}}'
Generate a standard GeoJSON Feature string from coordinate buffer and geometry type.
Arguments
coords— FlatFloat64Array[lng0, lat0, lng1, lat1, …]geometry_type— One of:"Point","LineString","Polygon","MultiPoint"Returns
A JSON string representing a GeoJSON Feature.
Example (JS)