mapbox-gl-native icon indicating copy to clipboard operation
mapbox-gl-native copied to clipboard

On Android sometimes labels do not show up

Open lcerveau opened this issue 9 years ago • 2 comments

This appears seldom but has shown up. The assumption is that it is linked to a download failure of fonts. Basically, when a style is downloaded it contains many elements, and among them fonts. However those ones do not seem to be used as the style json file is referring to remote fonts (mapbox:// URLs). It seems local fonts are not used, and a failure of download of remote would result in an absence of labels.

lcerveau avatar Dec 23 '16 18:12 lcerveau

Label rendering depends on having access to glyph data loaded via the network. If some of those requests fail, not rendering the labels is the expected behavior.

We have some long term plans to perhaps support rendering from local font data in some cases, but for now a reliable network is a requirement. For environments where that poses a problem, we offer offline maps. And as a workaround, if you create an offline region of any size, no matter how small, it will trigger caching of enough glyph data to render labels for any part of the world.

jfirebaugh avatar Jan 03 '17 23:01 jfirebaugh

Thank you for your reply. We have regularly this problem on a reliable wifi network. Is it possible that the timeout is too low? Is it not possible to implement a retry logic? If we download a small offline area (on the first app launch, for example), how to make sure the fonts are well cached?

jeankruger avatar Jan 05 '17 15:01 jeankruger