Skip to main content
Version: Next

genFeatureCollection()

function genFeatureCollection<G>(features, options): FeatureCollection<G, GeoJsonProperties>

Given array of features, return a feature collection with given properties. Generates reasonable default values for any properties not passed in The geometry type of the returned collection will match the one passed in Properties of features are retained

Type Parameters

Type ParameterDefault type
G extends GeometrySketchGeometryTypes

Parameters

ParameterType
featuresFeature<G, GeoJsonProperties>[]
optionsobject
options.id?string
options.name?string

Returns

FeatureCollection<G, GeoJsonProperties>