stamen / mapbox-gl-style-diff

Other
2 stars 1 forks source link

Use a layer metadata property to track layers #1

Closed peterqliu closed 1 year ago

peterqliu commented 2 years ago

Currently, we use layer id's as the immutable property to keep track of layers between before and after. This means the differ can't make sense of any changes to that property (i.e. renaming layers).

There are clever things we can do to guess whether a new layer is probably actually a renamed one (the new layer having many of the same properties as an old, deleted one), but it's not fully reliable.

One way to track changes while supporting variable layer names is attaching a unique identifier to the layer metadata -- assigning it upon layer creation in Maputnik, and preserving that across all layer mutations until the layer is deleted.

mulloverit commented 1 year ago

Stale, not enough of a problem to address.