style function

A style function allows you to specify layout or paint properties based on a map’s zoom level or a source’s data fields. Style functions allow you to style your data at runtime when building maps that use Mapbox GL.