Module
Description
The FeatureCollection type in the editable-types does not conform to the standard GeoJSON.FeatureCollection type provided by the GeoJSON namespace.
Expected Behavior
It feels appropriate to use the GeoJSON namespace instead of redefinining the types
I am willing to contribute to this with some guidance and discussion on the correct approach.
Steps to Reproduce
const [feature, setFeatures] = useState<GeoJSON.FeatureCollection>({
type: "FeatureCollection",
features: [],
});
const layer = new EditableGeoJsonLayer({
id: "geojson-layer",
data: feature, // ts error: see below
mode,
selectedFeatureIndexes: [],
onEdit: ({ updatedData }) => {
setFeatures(updatedData);
},
});
Type 'FeatureCollection<Geometry, GeoJsonProperties>' is not assignable to type 'FeatureCollection'.
Types of property 'features' are incompatible.
Type 'Feature<Geometry, GeoJsonProperties>[]' is not assignable to type 'Feature[]'.
Type 'Feature<Geometry, GeoJsonProperties>' is not assignable to type 'Feature'.
Type 'Feature<Geometry, GeoJsonProperties>' is not assignable to type 'FeatureOf<MultiPolygon>'.
Types of property 'geometry' are incompatible.
Type 'Geometry' is not assignable to type 'MultiPolygon'.
Type 'Polygon' is not assignable to type 'MultiPolygon'.
Types of property 'type' are incompatible.
Type '"Polygon"' is not assignable to type '"MultiPolygon"'.
Environment
- Framework version: 9.0.3
- Browser: Chrome
- OS: Mac
Logs
No response
Module
Description
The
FeatureCollectiontype in theeditable-typesdoes not conform to the standardGeoJSON.FeatureCollectiontype provided by theGeoJSONnamespace.Expected Behavior
It feels appropriate to use the GeoJSON namespace instead of redefinining the types
I am willing to contribute to this with some guidance and discussion on the correct approach.
Steps to Reproduce
Environment
Logs
No response