Thomas Milan
Thomas Milan

Reputation: 309

Mapbox GL JS unclustered point icon-image

I'm trying to display a clustered map with Mapbox GL JS.

Using this example from the documentation: https://www.mapbox.com/mapbox-gl-js/example/cluster/, I'd like to show a marker icon instead of a circle for unclustered points.

I modified the last addLayer call like this :

map.addLayer({
    id: "unclustered-point",
    type: "symbol",
    source: "companies",
    filter: ["!has", "point_count"],
    layout: {
        "icon-image": "marker-15", // THIS SHOULD BE A MARKER
        "icon-size": 5 // ZOOMED FOR DEMO
    },
});

Here is the result I got :

enter image description here

Why can't I get access to Maki Icons like it is suggested here : Mapbox GL js available icons

Upvotes: 2

Views: 2445

Answers (1)

Steve Bennett
Steve Bennett

Reputation: 126667

Without a link to your (non) working example, it's hard to diagnose fully, but one possibility is that that icon is not included in your style.

You could try starting from a style that definitely includes them, like these: https://github.com/mapbox/mapbox-gl-styles

Upvotes: 1

Related Questions