The NOBEARS Nuxt Mapbox Module provides a Nuxt 3 wrapper around Mapbox GL JS, offering a component-based API with built-in clustering support. It's designed to integrate seamlessly with Nuxt applications while maintaining full access to the Mapbox GL JS API.
The module exposes a set of Vue components that map directly to Mapbox GL JS concepts:
Mapbox: Basic wrapper for the Mapbox GL JS instance for simple use casesMapboxMap: Core map component that initializes the Mapbox GL JS instanceMapboxSource: Manages data sources (GeoJSON, Vector Tiles, Raster Tiles)MapboxLayer: Handles layer management with proper lifecycle hooksMapboxMarker: Renders markers with Vue componentsMapboxSupercluster: Implements efficient point clusteringMapboxClusterMarker: Renders cluster markers with expandable functionalityEach component is built with TypeScript and provides proper type definitions for props, events, and exposed methods. The module also includes utility functions for common map operations like focusing features, expanding clusters, and managing viewport bounds.
The module's API is organized into several categories:
Each component and utility is documented with TypeScript types, examples, and usage patterns. The documentation assumes familiarity with Vue 3, Nuxt, and basic mapping concepts.
The module requires a browser that supports WebGL and modern JavaScript features. It's tested against: