Skip to content

Deprecated ExistingSourceLayer

Miklós Fazekas edited this page Apr 7, 2023 · 2 revisions

Implicit reference to existing source/layers:

Deprecated:

<Mapbox.FillLayer id="building" style={{ visibility }} />
<Mapbox.LineLayer id="building-outline" style={{ visibility }} />

<Mapbox.VectorSource id="building" onPress={...} />

<Mapbox.VectorSource /> /* This is equivalent to <Mapbox.VectorSource id="composite" /> */

Replacement:

<Mapbox.FillLayer id="building" existing style={{ visibility }} />
<Mapbox.LineLayer id="building-outline" existing style={{ visibility }} />

<Mapbox.VectorSource id="building" existing onPress={...} />

Why:

Vectors/Sources needs to wait for the id to appear if they marked as existing. Regular layers don't have to wait.