Contents
How are labels applied in Mapbox GL maps?
Label hierarchy Map labels are applied to Mapbox GL maps as features in symbol layers. Symbol layers are the most complex layer type in the Mapbox Style Specification. The symbol layer type offers detailed typographic styling options for your labels and map data.
How are layers drawn in a map style?
Map styles contain a collection of style layers. Layers are specified in your style JSON and are drawn in order. This means that the first layer defined in the style JSON will be drawn first and will appear below all layers that follow. The last layer defined in the style JSON will be drawn last, on top of all other layers.
How does source compositing work in Mapbox Studio?
Source compositing happens by default for new styles created in Mapbox Studio. If you are adding sources on the client, they will not be composited. While detecting and preventing label collision helps improve map legibility, it can result in many hidden labels.
What does a style mean in Mapbox Studio?
A style is a set of rules for how Mapbox will draw your map on the page. It defines how all your data should be styled and includes references to your data and map images (icons, markers, patterns), fonts. For more about styles, see the Styles section of the Mapbox Studio Manual. Go to your Styles page.
How to add an image to a style in Mapbox?
To view all available images in a style’s sprite or add additional images, open the style in Mapbox Studio and click the Images tab. To add a new image to the style at runtime see the Add an icon to the map example. Mapbox GL requires WebGL support. Please check that you are using a supported browser and that WebGL is enabled.
Where do I find the icons in Mapbox?
This example uses the Mapbox Light style. The icon-image used in this example comes from the Mapbox Light style’s sprite. To view all available images in a style’s sprite or add additional images, open the style in Mapbox Studio and click the Images tab.
How to prevent labels from overlapping on a map?
Collision detection is the process of preventing labels on a map from overlapping each other. Styles use four properties to prevent label collision: By default icon-allow-overlap and text-allow-overlap are set to false.
How does collision detection work in Mapbox Studio?
For reliable collision detection across layers that come from different data sources, use source compositing. Source compositing happens by default for new styles created in Mapbox Studio. If you are adding sources on the client, they will not be composited.