Repository navigation
Conversation
4bafb00 to
1f2b317
Compare
| */ | ||
| batch: function(work) { | ||
| styleBatch(this, work); | ||
| update: function(classes, options) { |
There was a problem hiding this comment.
The terminology here is starting to feel overwhelming: mutate, update, change, cascade, recalculate...
How do you feel about picking a consistent verb (i.e. update, change) and differentiating these properties and methods with direct objects?
cascade->updateTransitionsrecalculate->updateZoommutations->updatesbroadcastLayers->updateWorkerLayersreloadSource->updateSourcechangeevent ->update
There was a problem hiding this comment.
Yes, great point! I like all the suggested renames except the change event, which we use throughout the code for other classes, and it's generally more common to have events like this called change rather than update in JS APIs.
There was a problem hiding this comment.
I'd also leave reloadSource -> updateSource rename for another PR because it's tricky, potentially involving a lot of changes that are out of scope for this PR (e.g. it calls source.reload, which in turn calls pyramid.reload, but pyramid also has update method which is different, so you also have to rethink pyramid API).
There was a problem hiding this comment.
I've renamed mutations, broadcastLayers and did some other minor cleanups/renames, but leaving the rest for future PRs (especially cascade and recalculate) so that it doesn't interfere with current DDS PRs, otherwise we would have a lot of conflicts to resolve.
| return this; | ||
| }, | ||
|
|
||
| _resetMutations: function() { |
There was a problem hiding this comment.
_resetMutations --> _resetUpdates
|
This is ready to 🚢 once you address the two minor comments above. Great work! I love a negative line PR. |
Closes #2343. Removes
map.batchand implements automatic batching of style changes, applying them once per frame. The style keeps track of all mutations done throughStylesetLayoutProperty,addLayer, etc., and then all mutations are applied with thestyle.updatemethod which is called inmap._renderand happens once per frame.Remaining tasks:
fix API accessor methods to immediately reflect style changes before they're batch-updated, as perthey do already removemap.batchand automatically batch style changes #2343 (comment)sprites-patternrender tests failed