Mapbox-gl typing won't allow accessToken assignment

前端 未结 3 2508
日久生厌
日久生厌 2021-02-20 00:54

I\'m using the mapbox-gl library with TypeScript, and I\'ve installed its community sourced type definitions with @types/mapbox-gl. When I try to import and set an

3条回答
  •  误落风尘
    2021-02-20 01:43

    You can also use this format:

    (mapboxgl as typeof mapboxgl).accessToken = ...
    

提交回复
热议问题