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
For those finding this now ... You don't even need to set the Mapbox accessToken
this way, it can be passed in as an option (since v1.2)
const map = new mapboxgl.Map({
accessToken: '...',
container: '...',
style: '...',
});
Pity it's not the method used in any of the examples (yet).
Docs: https://docs.mapbox.com/mapbox-gl-js/api/#map
1.2 release notes: https://github.com/mapbox/mapbox-gl-js/releases/tag/v1.2.0
PR that adds it: https://github.com/mapbox/mapbox-gl-js/pull/8364