0
votes

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

https://docs.mapbox.com/mapbox-gl-js/example/add-a-marker/

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

https://docs.mapbox.com/mapbox-gl-js/style-spec/layers/#symbol

map.addLayer({
    '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()

1

1 Answers

1
votes

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

https://github.com/mapbox/mapbox-gl-js/issues/656

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