mapbox / mapbox-gl-style-spec

76 stars 38 forks source link

Handle changes to a layer's 'source', 'source-layer', or 'type' in diffStyles #570

Closed anandthakker closed 7 years ago

anandthakker commented 7 years ago

Right now, changes to a layer's source, source-layer, ortypeproduce a correspondingsetLayerProperty` operation from diffStyles. On the GL JS side, I am pretty sure that the way to handle this will be to remove the layer and create/add a new one.

Does it make more sense for this to happen here or downstream where the change operations are being applied?

Doing it here bakes in the assumption that these properties of a style layer are immutable; doing it downstream means there might be some unweildy logic to watch for cases where one of these operations happens in conjunction with other changes to the layer.