@trackunit/react-map-adapter-mapbox
v0.0.8
Published
**Mapbox GL JS** adapter for the map system in `@trackunit/react-map`: it implements the shared adapter contract from [`@trackunit/react-map-adapter-shared`](../map-adapter-shared) using Mapbox GL.
Keywords
Readme
@trackunit/react-map-adapter-mapbox
Mapbox GL JS adapter for the map system in @trackunit/react-map: it implements the shared adapter contract from @trackunit/react-map-adapter-shared using Mapbox GL.
NX project name: react-map-adapter-mapbox
Public API
| Export | Role |
| --- | --- |
| mapboxAdapter | Factory that returns adapter config for useMap (from @trackunit/react-map) |
| MapboxConfig | Configuration type (access token, theme, language, etc.) |
| MapboxAdapterInstance | Low-level instance factory (advanced use) |
| MapboxRenderer | Internal renderer used by the adapter (advanced or testing) |
Typical usage
Pass the adapter into useMap from @trackunit/react-map. See the JSDoc on mapboxAdapter in source for a minimal example with accessToken, theme, and language.
Important for styles: Import Mapbox GL CSS once in your app entry (for example main.tsx):
import "mapbox-gl/dist/mapbox-gl.css";Dependencies
Depends on @trackunit/react-map-adapter-shared and Mapbox GL–related dependencies used by the renderer. It does not import @trackunit/react-map (adapters are consumed by the map package, not the reverse).
For more info and a full guide on Iris App SDK Development, please visit our Developer Hub.
Trackunit
This package was developed by Trackunit ApS. Trackunit is the leading SaaS-based IoT solution for the construction industry, offering an ecosystem of hardware, fleet management software & telematics.
