Closed elvince closed 2 months ago
Hi,
As per mapbox documentation, data should be optional: https://docs.mapbox.com/style-spec/reference/sources/#geojson
data
Optional .
A URL to a GeoJSON file, or inline GeoJSON.
Could you please fix this so undefined is properly managed? As of now, I must send an empty feature collection to avoid the warning.
Thanks,
Might be linked to : https://github.com/mapbox/mapbox-gl-js/issues/5986
Layer component prop types are directly imported from mapbox-gl
. This is an issue that should be fixed upstream.
Description
hi,
With my source setup like:
<Source id="missions" type="geojson" data={routes} lineMetrics={true}>
with routes be set as undefined, I have this warning:
Input data given to 'missions' is not a valid GeoJSON object
Expected Behavior
no warning as data can be undefined as per typsecript definition
Steps to Reproduce
create a map component with souce like
<Source id="missions" type="geojson" data={routes} lineMetrics={true}>
with routes asEnvironment
Logs
No response