Style Properties
Each layer type has specific style properties. Properties are categorized as:- Paint properties - Visual appearance (colors, opacity, width)
- Layout properties - Feature placement and visibility
Property Value Types
Static Values
Simple, constant values:Color Formats
Colors can be specified in multiple formats:Arrays
Some properties accept arrays:Property Reference by Layer
Circle Layer
- Paint
- Layout
Symbol Layer
- Text Paint
- Text Layout
- Icon Paint
- Icon Layout
Line Layer
- Paint
- Layout
Fill Layer
- Paint
- Layout
Fill Extrusion Layer
Raster Layer
Heatmap Layer
Property Functions
Properties can be dynamic based on zoom level or feature data.Zoom Functions
Change values based on zoom level:Step Functions
Discrete value changes:Property-based Values
Use feature properties:Case Expressions
Conditional styling:Transitions
Animate property changes:Transitions are handled automatically by the native SDK. Duration and easing are based on the Mapbox GL style specification defaults.
Using Images in Styles
Register images before using them in styles:Complete Example
Best Practices
- Use expressions for dynamic styling: Leverage zoom and feature properties for responsive designs
- Group related styles: Keep style objects organized and reusable
- Optimize property functions: Minimize the number of stops in interpolations
- Test across zoom levels: Ensure styles work well at all supported zoom levels
- Use appropriate property types: Follow the spec for each layer type
Related
- Expressions - Data-driven styling with expressions
- Layers - Layer types and usage
- Mapbox Style Specification - Complete reference