How to render text in a SymbolLayer while using map in offline mode? #1699
Unanswered
josh-cohen-rm
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
What is the best practice for rendering text in a SymbolLayer while using map in offline mode?
I am unable to render text in a SymbolLayer while using the map in offline mode. I am receiving error "Failed to load glyph range 0-255 for font stack Open Sans Bold,Arial Unicode". I am unable to use SymbolLayers in offline mode, and would appreciate your help!
Context
I have been able to successfully view a map in offline mode by creating offline packs with various styleUrls
In my map, I have a symbol layer for rendering some text on the map:
<MapboxGL.SymbolLayer id={'layer_id'} style={myStyle}/>
When I attempt to render the map, my symbol layer does not display. I see the "Failed to load glyph" error in my console.
Manual Attempt
To verify that I am using a style which DOES have an appropriate font stack, I tried this process with a manual style.
I manually created a style in Mapbox Studio which I know has font 'DIN Pro Regular'. I then used this style when downloading my offline pack, by specifying styleUrl 'mapbox://styles/josh-cohen-rm/ckyampo5e02co14o7tjvb06y2'. I updated my SymbolLayer to use font "DIN Pro Regular'. I verified in the progressListener that offline tiles were downloaded. However, when I navigate to the map, I see error 'Failed to load glyph range 0-255 for font stack DIN Pro Regular'.
Observations
It seems that SymbolLayers require extra precaution in offline mode -- I see a callout in the Mapbox offline mode documentation indicating:
However, my understanding is that I have downloaded appropriate style packs, so I should be able to see text!
Thank you in advance for your help!
Beta Was this translation helpful? Give feedback.
All reactions