Your Location is: Home > Mapbox-gl-js

How do I add standard markers to Mapbox using addLayer()

From: Switzerland View: 3695 Seph Reed 


If you simply add a marker, you get a standard marker:

If you use addLayer() there appears to be no description anywhere about how to use these standard markers:

    'id': 'POIs',
    'type': 'symbol',
    'source': 'POIs',
    'layout': {
        'icon-image': 'marker-15',  // this is a custom image... I just want a default, normal marker
        'icon-allow-overlap': true

It's really easy to add special symbols, but I just want default markers. How do I do this with addLayer()

Best answer

Hugely disappointing news. Somehow it's just not possible:

I guess you just have to iterate over whatever your data is and use addMarker() for each.