I'm currently going over a piece of code which uses MapBox GL JS and has an addSource() function which looks like this
this.mapAdapter.map.addSource(`${this.asset.uuid}-data`, {
type: 'geojson',
data: this.getMapboxGeometry(),
})
And another addLayer() function which looks like this
this.mapAdapter.map.addLayer({
id: `${this.asset.uuid}-polygon`,
type: 'fill',
source: `${this.asset.uuid}-data`,
filter: ['==', '$type', 'Polygon'],
}
I want to know what the difference between source and layer is. I can't seem to find a proper clear definition fo it.
The code for feature collection is as follows
type: 'FeatureCollection',
features: [
{
type: 'Feature',
properties: {},
geometry: {
type: 'Polygon',
...}
Are layers related to the feature collection in some way?
Are tilesets another name for sources or are they entirely different?