flywave-features-datasource.featuresdatasource.setfromgeojson
Home > @flywave/flywave-features-datasource > FeaturesDataSource > setFromGeojson
FeaturesDataSource.setFromGeojson() method
This method allows to directly add a GeoJSON without using [[MapViewFeature]] instances. It also overwrites existing features in this data source. To add a GeoJSON without overwriting the data source, one should loop through it to create [[MapViewFeature]] and add them with the add method.
Signature:
setFromGeojson(geojson: FeatureCollection | GeometryCollection | Feature): this;
Parameters
Parameter | Type | Description |
|---|---|---|
geojson | FeatureCollection | GeometryCollection | Feature | A javascript object matching the GeoJSON specification. |
Returns:
this