mapbox / mapbox/mapbox-plugins-android
Support for size of icons from sprite - Android
还没有人认领这个 Issue。
- 主要语言
- Java
- 星标
- 242
- 派生
- 116
- PR 合并指标
- 30 天内没有已合并 PR
描述
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?
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先检查 Android SymbolLayer 对 icon-image 属性的处理,以及 style.addImage(bitmapId, drawable) 入口点。将该行为与 sprite 和 style.json 的加载进行比较,包括离线使用;只有在定义并实现针对 DPI 相关图标的具体受支持方案后,这项工作才算完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- android
- 领域
- mobile
- Issue 类型
- 功能
- 难度
- 5/5
- 预计耗时
- 一周以上
- 活跃度
- 停滞
- 描述清晰度
- 需要澄清
- 新手友好度
- 25/100