Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Annotation plugin] Add bitmap API for Symbol #67

Merged
merged 2 commits into from
Feb 3, 2021
Merged

Conversation

Chaoba
Copy link
Contributor

@Chaoba Chaoba commented Feb 2, 2021

PRs must be submitted under the terms of our Contributor License Agreement CLA.
Fixes: < Link to related issues that will be fixed by this pull request, if they exist >

Pull request checklist:

  • Briefly describe the changes in this PR.
  • Include before/after visuals or gifs if this PR includes visual changes.
  • Write tests for all new functionality. If tests were not written, please explain why.
  • Add example if relevant.
  • Document any changes to public APIs.
  • Apply changelog label ('breaking change', 'bug 🪲', 'build', 'docs', 'feature 🍏', 'performance ⚡', 'testing 💯') or use the label 'skip changelog'
  • Add an entry inside this element for inclusion in the mapbox-maps-android changelog: <changelog>[Annotation plugin] Add bitmap API for Symbol</changelog>.

Summary of changes

This pr add the bitmap API for Symbol to enable users to add a bitmap to Symbol directly instead of adding it to style.
QQ20210203-144935

User impact (optional)

@Chaoba Chaoba self-assigned this Feb 2, 2021
@Chaoba Chaoba requested a review from a team February 2, 2021 10:22
@Chaoba Chaoba force-pushed the kl-annotation-bitmap branch from 52fdf72 to d5288b6 Compare February 2, 2021 12:56
Copy link
Member

@tobrun tobrun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One that this this issue isn't resolving yet is for the use-case of style loading. What will happen if I use the bitmap API and load a new style? The symbol is supposed to be shown again but the style image is not part of the style spritesheet. We need to take this use-case into account and readd style images when needed.

@Chaoba
Copy link
Contributor Author

Chaoba commented Feb 3, 2021

One that this this issue isn't resolving yet is for the use-case of style loading. What will happen if I use the bitmap API and load a new style? The symbol is supposed to be shown again but the style image is not part of the style spritesheet. We need to take this use-case into account and readd style images when needed.

Every time we change to a new style, the updateSource will be invoked and the bitmap will be added to the new style, so no worry about this scenario 😄 , I will attach a gif for it.

@Chaoba Chaoba requested review from tobrun and kiryldz February 3, 2021 07:05
Copy link
Member

@tobrun tobrun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is good for first iteration. I do think we can improve one specific use-case below but we can do that as tailwork:

  • what happens if a user adds 2 symbols using the same iconImageBitmap? It will currently add 2 bitmaps with 2 separate ids to the style. Ideally we only add one and reuse them.

@Chaoba Chaoba merged commit 4da0428 into main Feb 3, 2021
@Chaoba Chaoba deleted the kl-annotation-bitmap branch February 3, 2021 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants