I was able to follow along the example here for clustering. The issue is that I want my unclustered point to be an Icon and not a circle.
https://docs.mapbox.com/mapbox-gl-js/example/cluster/
That goes into detail on how to create a cluster. Im aware that to create a marker you use
let marker = new mapboxgl.Marker({})
But using this block of code for the unclustered point (notice the filter section)
map.addLayer({
id: "unclustered-point",
type: "circle",
source: "earthquakes",
filter: ["!", ["has", "point_count"]],
paint: {
"circle-color": "#11b4da",
"circle-radius": 4,
"circle-stroke-width": 1,
"circle-stroke-color": "#fff"
}
});
Now the options for they type include symbol, raster, fill, line, circle, fill-extrusion, background, heatmap, hillshade, custom.
I'm assuming I have to either use the custom or symbol type but i'm unsure. Custom doesn't allow me to add the filter so that is out of the equation.
The documentation for symbol type is here:
https://docs.mapbox.com/mapbox-gl-js/style-spec/#layers-symbol
I'm just not too sure that is the correct direction to head down? Any ideas or help would be appreciated.
Edit: Okay I see them mention to use the symbol property a few scrolls down here. I guess that means I would have to get my own marker images...
https://docs.mapbox.com/help/troubleshooting/working-with-large-geojson-data/