Getting Started
Installation and basic usage
Last updated
Installation and basic usage
Last updated
solid-map-gl
requires mapbox-gl
or maplibre-gl
as peer dependency
If you use vite
and get the following error:
'mapbox-gl.js' does not provide an export named 'default'
add this to your vite.config.ts
file:
optimizeDeps: {include: ['mapbox-gl']}
To use any of Mapbox’s tools, APIs, or SDKs, you’ll need a Mapbox . Mapbox uses access tokens to associate requests to API resources with your account. You can find all your access tokens, create new ones, or delete existing ones on your . Then pass the Mapbox access token via <MapGL> options
or .env
file as VITE_MAPBOX_ACCESS_TOKEN
By default, MapGL
component renders in a static mode. That means that the user cannot interact with the map.
In most cases, you will want the user to interact with the map. To do this, you need to provide onViewportChange
handler, that will update the map's viewport state.