To configure the Mapbox module and customize its behavior, you can use the mapbox property in your nuxt.config.ts file:
export default defineNuxtConfig({
modules: ['@nobears-front-end/nuxt-mapbox'],
mapbox: {
// Options
},
})
accessTokenThe accessToken is required to use the Mapbox API.
export default defineNuxtConfig({
modules: ['@nobears-front-end/nuxt-mapbox'],
mapbox: {
accessToken: process.env.NUXT_MAPBOX_ACCESS_TOKEN,
},
})
projectionDefault: mercator
The projection used for rendering the map.
As of v0.1.2, only mercator has been tested and is supported, other projections might lead to unexpected results.
export default defineNuxtConfig({
modules: ['@nobears-front-end/nuxt-mapbox'],
mapbox: {
projection: 'mercator',
},
})
styleDefault: mapbox://styles/mapbox/streets-v12
The style the map should be rendered in.
export default defineNuxtConfig({
modules: ['@nobears-front-end/nuxt-mapbox'],
mapbox: {
style: 'mapbox://styles/mapbox/streets-v12',
},
})