You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Note that style diffing is not currently built in to mapbox-gl-js: it's an external function which produces a set of commands to run in a batch style change.
Batching style mutations is what gave us the greatest perf boost, followed by the style diff. Diff'ing without batching is most likely a perf hit rather than a gain (for a non-trivial delta).
I'd like to keep the diff format compatible between JS and native if at all possible, although the JS diff is biased towards the mapbox-gl-js API.
I'd like to keep the diff format compatible between JS and native if at all possible, although the JS diff is biased towards the mapbox-gl-js API.
Me too, which means the first part of this change is porting all the JS style mutation APIs. It's something we've been meaning to do for quite some time, but a substantial change in and of itself.
It's also worth mentioning that mapbox-gl-js does not support every diff operation. In studio when we apply the diff, we fall back to a full setStyle if a particular operation is unsupported.
The most important operations to support are:
addLayer
removeLayer
setLayoutProperty
setPaintProperty
From there add support for any operation you see that frequently causes a setStyle fallback.
The semantics around add/removeLayer are particularly important to get right as the diff is optimized to avoid unnecessary work. For example, if you move a layer and change a property the diff will be two operations: removeLayer and addLayer.
Activity
mourner commentedon Sep 29, 2015
cc @scothis
jfirebaugh commentedon Sep 29, 2015
Note that style diffing is not currently built in to mapbox-gl-js: it's an external function which produces a set of commands to run in a batch style change.
scothis commentedon Sep 30, 2015
Batching style mutations is what gave us the greatest perf boost, followed by the style diff. Diff'ing without batching is most likely a perf hit rather than a gain (for a non-trivial delta).
I'd like to keep the diff format compatible between JS and native if at all possible, although the JS diff is biased towards the mapbox-gl-js API.
jfirebaugh commentedon Sep 30, 2015
Me too, which means the first part of this change is porting all the JS style mutation APIs. It's something we've been meaning to do for quite some time, but a substantial change in and of itself.
scothis commentedon Sep 30, 2015
It's also worth mentioning that mapbox-gl-js does not support every diff operation. In studio when we apply the diff, we fall back to a full setStyle if a particular operation is unsupported.
The most important operations to support are:
From there add support for any operation you see that frequently causes a setStyle fallback.
The semantics around add/removeLayer are particularly important to get right as the diff is optimized to avoid unnecessary work. For example, if you move a layer and change a property the diff will be two operations: removeLayer and addLayer.
jfirebaugh commentedon Oct 2, 2015
Depends on #837, more or less.
jfirebaugh commentedon Feb 11, 2017
⇢ #7893