Skip to content

Commit ea73bc5

Browse files
committed
Handle initial source data
1 parent 7897f4b commit ea73bc5

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/map/core/useMapLayer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const useMapLayer = ({ enabled = true, source, layers, layersDeps, data, dataDep
1313
const isGeoJson = !source?.type || source.type === 'geojson';
1414
map.addSource(
1515
id,
16-
isGeoJson ? { type: 'geojson', data: emptyFeatureCollection, ...source } : source,
16+
isGeoJson ? { type: 'geojson', data: data ?? emptyFeatureCollection, ...source } : source,
1717
);
1818
layers.forEach((layer) => {
1919
const { on, key, ...spec } = layer;

0 commit comments

Comments
 (0)