Closed lightstrike closed 1 year ago
When importing MapboxGeoJSONFeature like so:
MapboxGeoJSONFeature
import type { MapboxGeoJSONFeature, MapLayerMouseEvent, MapRef } from 'react-map-gl';
The following error is thrown:
'"react-map-gl"' has no exported member named 'MapboxGeoJSONFeature'. Did you mean 'MapGeoJSONFeature'?
This type exists in the docs, yet no where else in the codebase. I am trying to use a type that includes the coordinates property for the following:
coordinates
mapRef?.current?.easeTo({ center: feature.geometry?.coordinates, zoom, duration: 500 });
If I try to replace MapboxGeoJSONFeature with MapGeoJSONFeature, the following error is thrown:
MapGeoJSONFeature
Property 'coordinates' does not exist on type 'Geometry'. Property 'coordinates' does not exist on type 'GeometryCollection<Geometry>'.
No response
app.tsx
npm start
The type is now called MapGeoJSONFeature. There is an open PR that updates the docs.
Backward compatibility is fixed in v7.1.5.
Description
When importing
MapboxGeoJSONFeature
like so:The following error is thrown:
'"react-map-gl"' has no exported member named 'MapboxGeoJSONFeature'. Did you mean 'MapGeoJSONFeature'?
This type exists in the docs, yet no where else in the codebase. I am trying to use a type that includes the
coordinates
property for the following:If I try to replace
MapboxGeoJSONFeature
withMapGeoJSONFeature
, the following error is thrown:Expected Behavior
No response
Steps to Reproduce
app.tsx
withimport type { MapboxGeoJSONFeature, MapLayerMouseEvent, MapRef } from 'react-map-gl';
npm start
or view TS import error in code editor.Environment
Logs
No response