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

[location] Update the location indicator to use layer persistence #473

Merged
merged 8 commits into from
Jun 15, 2021

Conversation

jmkiley
Copy link
Contributor

@jmkiley jmkiley commented Jun 14, 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-ios changelog: <changelog></changelog>.
  • Update the migration guide, API Docs, Markdown files - Readme, Developing, etc

Summary of changes

This PR:

  • Updates the LocationStyleDelegate to use _addPersistentLayer(). This allows the user location puck to carry over to new styles. The default behavior of the LocationIndicatorLayer has not changed. It now uses layer persistence as opposed to watching for style changes.
  • Removed the style change subscriber, which was a workaround for lack of layer persistence.

iOS equivalent to the location portion of mapbox/mapbox-maps-android#368

User impact (optional)

@jmkiley jmkiley added the feature 🍏 When working on a new feature or feature enhancement label Jun 14, 2021
@CLAassistant
Copy link

CLAassistant commented Jun 14, 2021

CLA assistant check
All committers have signed the CLA.

@@ -59,7 +59,7 @@ class LocationIndicatorLayerIntegrationTests: MapViewIntegrationTestCase {

// Add the layer
do {
try style.addLayer(layer)
try style._addPersistentLayer(layer)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will update style gen for this change.

@jmkiley jmkiley merged commit 85c7336 into main Jun 15, 2021
@jmkiley jmkiley deleted the jk/location-layer-persistence branch June 15, 2021 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature 🍏 When working on a new feature or feature enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants