Contents
What is a source layer?
A source layer is an individual layer of data within a vector source. A vector source can have multiple source layers. A source layer differs from a style layer, which is used to add styling rules to a specific subset of data in a map style.
How does Mapbox GL work?
Mapbox GL fetches geospatial data from vector tiles and style instructions from a style document and helps the client draw 2D and 3D Mapbox maps as dynamic visual graphics with OpenGL.
What is Mapbox source?
A source supplies the data that Mapbox GL displays on a map. Sources are defined by the Mapbox Style Specification, and are used with style layers to visually represent the source data on to a map.
How to define a source in Mapbox GL JS?
A map or layer source states which data the map should display. Specify the type of source with the “type” property, which must be one of vector, raster, raster-dem, geojson, image, video. A source provides map data that Mapbox GL JS can use with a style document to render a visual representation of that data.
How are map loads counted in Mapbox gljs?
Mapbox GL JS is billed by Map loads. A Map load is counted every time Mapbox GL JS initializes on a webpage or in a web application. Each map load includes unlimited vector, raster, and terrain tile API requests.
Where can I find the source layer in Mapbox?
You can find a source layer’s name in the Mapbox Studio Tileset explorer: Visit your Tilesets page. Click the name of one of your tilesets to open Tileset explorer. You will see the tileset’s source layers listed under Vector layers. You can find the name of source layers used in a style using the Select data tab:
Where to store GeoJSON in Mapbox GL JS?
If possible, consider loading your GeoJSON from a data URL instead of holding it in a JavaScript object and passing to a Mapbox GL GeoJSON Source. This reduces client memory overhead. There are many different places where you can store your data.