We are currently building an asset tracking widget using Mapbox-GL. When zoomed in, we show the actual assets, and this works fine. But, when zooming out, we would like to switch to a cluster view to get a proper overview of how many assets are where.
From my understanding, such layer needs to have a predefined datasource. eg. GeoJson.
Is there any way to feed Mapbox-GL data from live JS data? The assets themselves are markers, an afaik there is no way to switch from makers to something else. So I assume we would have to generate the datasource from the data that makes up the markers somehow?
The sources seems to be using URL's for getting the actual data so I'm at loss here, Can I transform a set of geo points into something that MapboxGL can use as a data source?