Closed wakywayne closed 1 year ago
Ran into the same issue, this is happening because you're not loading Mapbox' css that's required to make those markers work well. Just add this import to your <head/>
:
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v2.9.2/mapbox-gl.css' rel='stylesheet' />
Or import it in some other way. Instantly fixed it for me. Found the 'answer' here: https://docs.mapbox.com/help/tutorials/custom-markers-gl-js/, and you'll also notice Mapbox logged an error with a not-quite-helpful link in the console that some css was still missing.
I am using a fixed-sized map which I assume is the issue. Also worth notin I am in nextJs, but I don't think that is the issue. Are there any workarounds for this?
Here is my code
CSS