Use "sprite": "https://cdn.tmb.cat/icons/v2.2.0/static/mapboxgl/sprites"
in your mapboxgl style definition.
Then use them as "icon-image" property in a layer:
{
"id": "estacions",
"type": "symbol",
"source": "estacions",
"maxzoom": 16,
"layout": {
"icon-image": "{PICTO}",
"icon-size": {
"stops": [
[10, 0],
[11, 0.2],
[13, 0.25],
[20, 0.5]
]
},
"icon-allow-overlap": true,
"text-field": "{NOM_ESTACIO}",
"text-font": [
"Open Sans Semibold"
],
"text-offset": [1, 0],
"text-anchor": "left",
"text-size": {
"stops": [
[12.9, 0],
[13, 11],
[20, 24]
]
},
"text-optional": true
},
"paint": {
"text-halo-width": 1,
"text-halo-color": "#000000",
"text-color": "#FFFFFF"
}
}