I'm completely new to vector tiles and mapbox. In order to test different icons, fills, etc. I found Maputnik would be the best option. Working with regular outlines, fills and other primitives is just fine but when it came to implementing custom icons and text labels I became confused.

Using spritezero-cli I created a custom sprite: https://raw.githubusercontent.com/yaras-phoenix/test/master/sprite/test_sprite

And according to this tutorial I created a simple onefont-fontstack: https://developer.tomtom.com/maps-sdk-web/tutorials-advanced/creating-custom-glyphs

I placed my links in Maputnik's Style Settings and expected to fill "Pattern" option to be activated and to see my font in text "Font" drop-down list but none of that happened.

Sprite's .json and .png files are fetched with code 200 but Maputnik seems to expect one more file I don't have. I see "GET https://raw.githubusercontent.com/yaras-phoenix/test/master/glyphs.json 404 (Not Found)" in Chrome DevTools. So I guess I need some extra json file.

Could anyone point me in some direction? I'm quite sure I do something wrong.


Answering my own question.

Seems that something in Maputnik is not working in version 1.6.1 because defining the icon I need in"fill-pattern" parameter made it work.

Then, the glyphs. I haven't found this information in Mapbox GL JS specs but I created a .json file with the list of fonts used in square brackets and placed it in the root folder. This made glyphs work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.