2
votes

I've got a simple application working using mapbox-gl.js, and adding a marker layer with geoJSON. This works well if I use Mapbox's 'Streets' style, or if I duplicate the streets style as a custom style on my account.

However, I want to use a custom style based on the 'Light' style, and it appears that this doesn't include something that's required for displaying icons.

I've downloaded both styles as JSON, and swapped out the sprite property, but that hasn't made a difference.

I've experimented with starting with the 'Streets' style and adjusting it to look the way I want, but that's a lot of changes to organise.

Is there something I can do, either in Mapbox Studio, or in the JS, to allow standard markers to be drawn?

1
Well here's something i'de myself would really like to know. I've recently experimented with that for this answer: stackoverflow.com/questions/35248310/… but have found no way of uploading/creating you own via Studio. I've downloaded the sprite.svg and sprite.json from streets and tried to upload them. Afaik nothing works. I think it's still being developed. Really hope someone from Mapbox would chime in here.iH8

1 Answers

5
votes

The set of icons available to a Mapbox style is determined by the style's sprite sheet.

Mapbox Streets (and clones of Mapbox Streets) include a default sprite sheet with the set of Maki icons.

Custom styles built from scratch (and several other official Mapbox styles) do not include a sprite sheet by default. You can add icons to these styles by following this guide.

I hope this helps!

EDIT: Per feedback from users (including you!) we are adding a standard set of icons to all our styles, including this one. You can expect the new styles to be deployed as of tomorrow. https://github.com/mapbox/mapbox-gl-styles/issues/241