mapbox / mapbox/mapbox-plugins-android

Support for size of icons from sprite - Android

Open
#1,077 0 comments 0 reactions 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

Hi,
We use custom images for as "icon-image" property in SymbolLayer on Android. We want to support different dpi. For now, we create a few images for each dimension i.e 24px, 48xp, 72px etc. Base on device dpi we take proper image and add it into style via
style.addImage(bitmapId, drawable)
We wonder if there is a better approach. I check sprite but I don't see the option to add it from code. We also have to work in offline mode. Should we create each sprite file for each dimension and change style.json file or there is a better way to do it?

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 by reviewing Android SymbolLayer handling for the icon-image property and the style.addImage(bitmapId, drawable) entry point. Compare that behavior with sprite and style.json loading, including offline use; the work is complete only when a concrete supported approach for DPI-dependent icons is defined and implemented.

Written by the indexing model from the issue text.

Assessment

Tech stack
android
Domain
mobile
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.