mapbox / mapbox/mapbox-plugins-android

Offline map font download.

Open
#1,049 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
242
Forks
116
PR merge metrics
No merged PRs in 30d

Description

I am trying to display text on an offline map,

        val textSymbol = SymbolOptions()
                .withLatLng(LatLng(item.latitude, item.longitude))
                .withTextField("TEST")
               .withTextColor(ColorUtils.colorToRgbaString(Color.WHITE))
               .withZIndex(50)
               .withTextFont(arrayOf("Roboto Black"))

this works well when online, but doesn't work at all when offline.

I have added the Font Roboto Black to in the Mapbox Studio. (Fonts -> Upload new font) for my style.
but I don't know if I should also do another action. Like, apply a font to region or zoom levels. (not sure how to do that)

after downloading the offline regions all the maps are displayed correctly but the text doesn't show. (it works well when online)
also, I can't find any downloaded fonts or anything inside the android/data/my.package/ folder or its subfolders.

I am not married to this font and at this point, I would be glad for any font that would display text when in offline mode. tho nothing I put in the .withTextFont() method seems to produce any results.

Regards.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with SymbolOptions.withTextFont and the offline region download flow, then reproduce the difference between online and offline rendering using the Roboto Black font configured in Mapbox Studio. Trace how offline map resources are stored and loaded; done means text using a configured font renders after the region is downloaded without connectivity.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.