Open DennisGuo opened 2 years ago
the same problem happened !!!
Everyone, I I solved it.
const map = new mapboxgl.Map({
container: 'map',
style: 'mapbox://styles/mapbox/satellite-streets-v11',
zoom: 1.8,
center: [118, 40]
})
const language = new MapboxLanguage({
defaultLanguage: 'zh-Hans'
})
map.addControl(language)
map.on('load', () => {
map.setStyle(
Object.assign({}, map.getStyle(), { projection: { name: 'globe' } })
)
})
When I use
{projection: "globe"}
to init map will cause th error .The error info
if i do not use
{projection: "globe"}
, it work find !