Skip to main content

Slots

SDK SupportMapbox GL JSAndroid SDKiOS SDK

basic functionality

>= 3.0.0>= 11.0.0>= 11.0.0

Overview

Slots allow style authors to create well-defined insertion points that users can put their own layers into. This enables multiple styles to use the same named slots so that custom layers appear at the correct position. Users don’t have find the most appropriate basemap layer name, and insert their own layer in relation to it. Instead, they can rely on an explicitly named slot.

Slots are defined by style authors as a layer of type slot. A slot layer only acts as a placeholder and does not render anything by itself. It has the generic layer properties like id, type, but does not have any other styling properties like layout, paint, or source.

Note that the slot names depend on the basemap style you’re using. For information on what slots are available in a given style, consult the documentation of that style.

Was this page helpful?