While yesterday my code was working smoothly and I have not modified it, today Mapbox suddenly stopped showing place names, except for at a certain zoom level:
Here is my code:
const tkn = document.getElementById('t').getAttribute('data-t');
mapboxgl.accessToken = tkn;
const map = new mapboxgl.Map({
container: 'mappa', // id
style: 'mapbox://styles/mapbox/streets-v11?optimize=true',
center: [12.3424, 42.3011], // [lng, lat]
zoom: 3.7,
projection: 'globe'
});
map.on('style.load', () => {
map.setFog({
'color': '#8BF9EC', // Lower atmosphere
'high-color': '#0ac2ac', // Upper atmosphere
'horizon-blend': 0.1, // Atmosphere thickness (default 0.2 at low zooms)
'space-color': '#011311',
});
// Set map in Italian:
map.getStyle().layers.forEach(function(thisLayer){
if(thisLayer.type == 'symbol'){
map.setLayoutProperty(thisLayer.id, 'text-field', ['get','name_it'])
};
});
//
});
What can I do to solve the problem? Thanks!