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

Remove unused images when updating point annotations #1583

Merged
merged 4 commits into from
Sep 19, 2022

Conversation

evil159
Copy link
Contributor

@evil159 evil159 commented Sep 16, 2022

PointAnnotationManager can add images from point annotations to style, but doesn't remove them when annotations are updated or when the manager is destroyed. This PR makes point annotation manager to remove unused images when updating annotations, as well as to remove all annotation images when the manager gets destroyed.

Memory consumption when annotations being added(1st event) and removed(2nd event)
Before
After

Pull request checklist:

  • Describe the changes in this PR, especially public API changes.
  • 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 a changelog entry to to bottom of the relevant section (typically the ## main heading near the top).

PRs must be submitted under the terms of our Contributor License Agreement CLA.

@evil159 evil159 requested a review from a team as a code owner September 16, 2022 12:49
Copy link
Contributor

@OdNairy OdNairy left a comment

Choose a reason for hiding this comment

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

This is awesome! Well done!

@evil159 evil159 enabled auto-merge (squash) September 19, 2022 10:22
@evil159 evil159 merged commit 71d9a83 into main Sep 19, 2022
@evil159 evil159 deleted the rl/MAPSIOS-298-remove-unused-annotation-images branch September 19, 2022 10:32
persidskiy pushed a commit that referenced this pull request Feb 24, 2023
* Fix for Style/updateLayer fail if nested properties dictionary contains nil (#1565)

- Error happens due to layer's properties contains nil values for nested keys, for these keys, default values will not be applied so they would appear as nil when updating a layer. The fix is to only apply nil encoding for the root properties of the dictionary.

* Flag MapRecorder with @_spi(Internal) (#1582)

* Remove unused images when updating point annotations (#1583)

* Parse GeoJSON data on a background queue (#1576)

* Fix toString conversion on iOS 12 (#1584)

* Use asynchronous GeoJSON marshaling in annotation managers (#1588)

* update generated docs (#1586)

* Fix GeoJSONData.url incorrectly converting to string (#1587)

* Expose distance-from-center and pitch expressions  (#1559)

* Bump MapboxCoreMaps and MapboxCommon (#1589)

* Expose opacity for location puck (#1585)

* Fix merge issues

Co-authored-by: Mai Mai <mai.mai@mapbox.com>
Co-authored-by: Roman Laitarenko <roman.laitarenko@mapbox.com>
Co-authored-by: Ankur Khandelwal <ankur.khandelwal@mapbox.com>
Co-authored-by: Tobrun <tobrun.van.nuland@gmail.com>
Co-authored-by: ZiZi <44972592+ZiZasaurus@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants