Style layers

The Annotation API makes it unnecessary to write much of the code that would otherwise be required to implement runtime and data-driven styling. But, it is possible to add style layers directly, and in some circumstances doing so will be beneficial.

Benefits:

  • Efficient and performant when adding many features to the map using a vector source.
  • Also compatible with GeoJSON sources.
  • Many style customization options.

Limitations:

  • No default image available.
  • User interactions are not built-in and will require writing custom code.
  • Need to learn the APIs and usage of layers which can be time intensive.
  • Might need to learn how to use expressions to control the source data or use data-driven styling.
related
Map styles: Work with layers

Use the Mapbox Maps SDK for iOS to add, remove, and modify layers rendered in a map style.

related
Style layer API reference

API reference documentation for adding style layers using the Maps SDK.