
Security News
New React Server Components Vulnerabilities: DoS and Source Code Exposure
New DoS and source code exposure bugs in React Server Components and Next.js: what’s affected and how to update safely.
nuxt-mapbox
Advanced tools
nuxt-mapbox & mapbox-gl dependencies to your projectnpx nuxi@latest module add nuxt-mapbox
npm install --save-dev mapbox-gl
nuxt-mapbox to the modules section of nuxt.config.tsexport default defineNuxtConfig({
modules: [
'nuxt-mapbox'
]
})
mapbox section of nuxt.config.tsexport default defineNuxtConfig({
modules: [
'nuxt-mapbox'
],
mapbox: {
accessToken: '{API_KEY}'
}
})
View the Mapbox GL JS Docs for reference.
Map instances are created with components. You can provide all the options through component props
Example:
<MapboxMap
map-id="{ID}"
style="position: absolute; top: 0; bottom: 0; left: 250px; width: 500px;"
:options="{
style: 'mapbox://styles/mapbox/light-v11', // style URL
center: [-68.137343, 45.137451], // starting position
zoom: 5 // starting zoom
}"
/>
You can add Layers, Sources & Controls by nesting their respective components inside the Map
Examples:
<MapboxMap
...
>
<MapboxSource
source-id="{ID}"
:source="{
type: 'geojson',
data: '/test.geojson'
}"
/>
<MapboxLayer
:layer="{
source: '{ID}',
id: 'geojson-layer',
type: 'fill'
}"
/>
<MapboxGeolocateControl position="top-left" />
</MapboxMap>
# Install dependencies
npm install
# Generate type stubs
npm run dev:prepare
# Develop with the playground
npm run dev
# Build the playground
npm run dev:build
# Run ESLint
npm run lint
# Run Vitest
npm run test
npm run test:watch
# Release new version
npm run release
FAQs
Elegant Mapbox GL JS integration with Nuxt
The npm package nuxt-mapbox receives a total of 2,548 weekly downloads. As such, nuxt-mapbox popularity was classified as popular.
We found that nuxt-mapbox demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
New DoS and source code exposure bugs in React Server Components and Next.js: what’s affected and how to update safely.

Security News
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.

Security News
GitHub has revoked npm classic tokens for publishing; maintainers must migrate, but OpenJS warns OIDC trusted publishing still has risky gaps for critical projects.