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

Use Style#setState for all style-mutating Map methods #3651

Closed
8 tasks
anandthakker opened this issue Nov 17, 2016 · 2 comments
Closed
8 tasks

Use Style#setState for all style-mutating Map methods #3651

anandthakker opened this issue Nov 17, 2016 · 2 comments

Comments

@anandthakker
Copy link
Contributor

Change each of the following Map methods to delegate to Style#setState:

  • addLayer
  • removeLayer
  • moveLayer (this will either have to wait for Make use of moveLayer in Style#setState #3649 or cause a temporary perf regression until 3649 is completed.)
  • addSource
  • removeSource
  • setFilter
  • setLayerZoomRange
  • setLight

Additionally:

  • Make corresponding Style methods _private.
  • Remove Map#getLayer(), so that we can guarantee that all style mutations flow through setState. (Alternatively, Map#getLayer() could be changed to return a serialized version of StyleLayer instead of the class instance.)

This should bring Style's internally-public API down to { setState: (partialState: obj) => void, update: (options: obj) => void }, where setState queues a state change and update applies all queued state changes.

@anandthakker
Copy link
Contributor Author

This is a followup to #3621

@anandthakker
Copy link
Contributor Author

Closing this in favor of #4875

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

No branches or pull requests

1 participant