good first issue
Description
Motivation
I often use this pattern for GeoJSON sources:
- addSource('mysource', { type: 'geojson', data: { type:'FeatureCollection', features: [] }});
- addLayer({ id: 'mylayer', source: 'mysource' })
- Now fetch the actual data, manipulate it, and call setData() to set it.
I do this because:
- I need to fetch the data asynchronously (but I don't want to hold up all my other init)
- I want the layer to be in a predictable place in the style (which I wouldn't get if I waited for the data to load before creating the source and the layer).
This doesn't work with the Image type because you have to provide some kind of actual data.
It would be more flexible thus if the image type didn't require data, like the geojson type.