I think we should automatically batch all style changes that happen between frames. Are there any cases where we wouldn't want to batch style changes?
If changes are automatically batched we can remove map.batch.
Yes, I think this would be ideal, although implementation may be tricky. cc @scothis
I think this is safe and good, we're effectively taking methods that were partially sync and partial async and pushing the balance more towards async. It could break a user if they made a mutation and expected to be able to query against it immediately. Given that the stylesheet mutation can still be done sync before deferring the heaving lifting async, this should be fine.
Yeah, it would be nice to have the style API work like the DOM API: mutations are reflected immediately in subsequent API accessor methods, but as much heavy work as possible is delayed until the next frame tick, at which time duplicate work is coalesced.
I propose that we
StyleLayer#cascade to only touch properties that have changed since the last cascadeIs this relating to smart setStyle in #1989 and #1341, as the new release v0.17.0?
@jingsam "smart" setStyle is not implemented and being tracked in https://github.com/mapbox/mapbox-gl-js/issues/1391
Most helpful comment
I think this is safe and good, we're effectively taking methods that were partially sync and partial async and pushing the balance more towards async. It could break a user if they made a mutation and expected to be able to query against it immediately. Given that the stylesheet mutation can still be done sync before deferring the heaving lifting async, this should be fine.