Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Refactor Style object hierarchy #927

Closed
kkaefer opened this issue Feb 27, 2015 · 3 comments
Closed

Refactor Style object hierarchy #927

kkaefer opened this issue Feb 27, 2015 · 3 comments
Labels

Comments

@kkaefer
Copy link
Member

kkaefer commented Feb 27, 2015

Our current Style object hierarchy is a little messy: Worker threads depend on it being immutable, but it really isn't. We don't have a clear concept for changing/swapping styles, and not a clear object ownership.

@ljbade
Copy link
Contributor

ljbade commented Feb 27, 2015

My ideas:

  • make style immutable, ie all the change functions return a new style object copied from the current with the changes
  • have a single 'master' style object in map that gets atomically swapped (or locking swap)
  • every worker job gets a copy of the 'master' style when it is created
  • to update/load new styles you create the new style object with the change functions, then call some function that switches out the 'master' style

@mikemorris
Copy link
Contributor

Mutable styles could be responsible for https://github.com/mapbox/node-mapbox-gl-native/issues/64

@jfirebaugh
Copy link
Contributor

The dependent bugs above are now fixed. Remaining actions tracked in #667.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants