Skip to content
This repository has been archived by the owner on Apr 10, 2018. It is now read-only.

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

Closed
anandthakker opened this issue Nov 15, 2016 · 0 comments
Assignees

Comments

@anandthakker
Copy link
Contributor

anandthakker commented Nov 15, 2016

Right now, changes to a layer's source, source-layer, or typeproduce 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.

anandthakker pushed a commit that referenced this issue Nov 15, 2016
Two cases:

- Fix #570 - remove/re-add layer when `source`, `source-layer`, or
  `type` properties are changed.
- Remove all dependent layers before removing a source; if the source is
  being removed and re-added, then the corresponding layers are also
  added again afterward. (See mapbox/mapbox-gl-js#3621 (comment))
anandthakker added a commit that referenced this issue Nov 16, 2016
* Remove/re-add layers when source-related properties change

Two cases:

- Fix #570 - remove/re-add layer when `source`, `source-layer`, or
  `type` properties are changed.
- Remove all dependent layers before removing a source; if the source is
  being removed and re-added, then the corresponding layers are also
  added again afterward. (See mapbox/mapbox-gl-js#3621 (comment))

* Add explainer comment

* Fix lint

* Slightly better readability

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

No branches or pull requests

2 participants