Builds a transformStyle callback that carries the GeoLeaf-owned sources and
layers from the previous style into the next one, appending the layers after
the incoming basemap layers so they render on top (correct z-order). The raster
basemap injection path re-inserts its layer at the bottom independently, so a
vector→raster swap keeps GeoLeaf layers on top as well.
Ownership is passed in (snapshotted from the adapter's layer registry) rather
than inferred from id conventions, so the merge is authoritative. Preserved
layers keep their serialized paint/layout (e.g. taxonomy match expressions and
visibility), and GeoJSON sources keep their serialized data — hence the
rebuild is unnecessary.
Builds a
transformStylecallback that carries the GeoLeaf-owned sources and layers from the previous style into the next one, appending the layers after the incoming basemap layers so they render on top (correct z-order). The raster basemap injection path re-inserts its layer at the bottom independently, so a vector→raster swap keeps GeoLeaf layers on top as well.Ownership is passed in (snapshotted from the adapter's layer registry) rather than inferred from id conventions, so the merge is authoritative. Preserved layers keep their serialized paint/layout (e.g. taxonomy
matchexpressions andvisibility), and GeoJSON sources keep their serializeddata— hence the rebuild is unnecessary.