mapbox-maplibre-migration
Guide for migrating from MapLibre GL JS to Mapbox GL JS, covering API compatibility, token setup, style configuration, and the benefits of Mapbox's official support and ecosystem
What this skill does
# MapLibre to Mapbox Migration Skill Expert guidance for migrating from MapLibre GL JS to Mapbox GL JS. Covers the shared history, API compatibility, migration steps, and the advantages of Mapbox's platform. ## Understanding the Fork ### History **MapLibre GL JS** is an open-source fork of **Mapbox GL JS v1.13.0**, created in December 2020 when Mapbox changed their license starting with v2.0. **Timeline:** - **Pre-2020:** Mapbox GL JS was open source (BSD license) - **Dec 2020:** Mapbox GL JS v2.0 introduced proprietary license - **Dec 2020:** Community forked v1.13 as MapLibre GL JS - **Present:** Both libraries continue active development **Key Insight:** The APIs are ~95% identical because MapLibre started as a Mapbox fork. Most code works in both with minimal changes, making migration straightforward. ## Why Migrate to Mapbox? **Compelling reasons to choose Mapbox GL JS:** - **Official Support & SLAs**: Enterprise-grade support with guaranteed response times - **Superior Tile Quality**: Best-in-class vector tiles with global coverage and frequent updates - **Better Satellite Imagery**: High-resolution, up-to-date satellite and aerial imagery - **Rich Ecosystem**: Seamless integration with Mapbox Studio, APIs, and services - **Advanced Features**: Traffic-aware routing, turn-by-turn directions, premium datasets - **Geocoding & Search**: World-class address search and place lookup - **Navigation SDK**: Mobile navigation with real-time traffic - **No Tile Infrastructure**: No need to host or maintain your own tile servers - **Regular Updates**: Continuous improvements and new features - **Professional Services**: Access to Mapbox solutions team for complex projects **Mapbox offers a generous free tier:** 50,000 map loads/month, making it suitable for many applications without cost. ## Quick Comparison | Aspect | Mapbox GL JS | MapLibre GL JS | | --------------------- | ----------------------------- | --------------------------------- | | **License** | Proprietary (v2+) | BSD 3-Clause (Open Source) | | **Support** | Official commercial support | Community support | | **Tiles** | Premium Mapbox vector tiles | OSM or custom tile sources | | **Satellite** | High-quality global imagery | Requires custom source | | **Token** | Required (access token) | Optional (depends on tile source) | | **APIs** | Full Mapbox ecosystem | Requires third-party services | | **Studio** | Full integration | No native integration | | **3D Terrain** | Built-in with premium data | Available (requires data source) | | **Globe View** | v2.9+ | v3.0+ | | **API Compatibility** | ~95% compatible with MapLibre | ~95% compatible with Mapbox | | **Bundle Size** | ~500KB | ~450KB | | **Setup Complexity** | Easy (just add token) | Requires tile source setup | ## Step-by-Step Migration ### 1. Create Mapbox Account 1. Sign up at [mapbox.com](https://mapbox.com) 2. Get your access token from the account dashboard 3. Review pricing: Free tier includes 50,000 map loads/month 4. Note your token (starts with `pk.` for public tokens) ### 2. Update Package ```bash # Remove MapLibre npm uninstall maplibre-gl # Install Mapbox npm install mapbox-gl ``` ### 3. Update Imports ```javascript // Before (MapLibre) import maplibregl from 'maplibre-gl'; import 'maplibre-gl/dist/maplibre-gl.css'; // After (Mapbox) import mapboxgl from 'mapbox-gl'; import 'mapbox-gl/dist/mapbox-gl.css'; ``` Or with CDN: ```html <!-- Before (MapLibre) --> <script src="https://unpkg.com/[email protected]/dist/maplibre-gl.js"></script> <link href="https://unpkg.com/[email protected]/dist/maplibre-gl.css" rel="stylesheet" /> <!-- After (Mapbox) --> <script src="https://api.mapbox.com/mapbox-gl-js/v3.0.0/mapbox-gl.js"></script> <link href="https://api.mapbox.com/mapbox-gl-js/v3.0.0/mapbox-gl.css" rel="stylesheet" /> ``` ### 4. Add Access Token ```javascript // Add this before map initialization mapboxgl.accessToken = 'pk.your_mapbox_access_token'; ``` **Token best practices:** - Use environment variables: `process.env.VITE_MAPBOX_TOKEN` or `process.env.NEXT_PUBLIC_MAPBOX_TOKEN` - Add URL restrictions in Mapbox dashboard for security - Use public tokens (`pk.*`) for client-side code - Never commit tokens to git (add to `.env` and `.gitignore`) - Rotate tokens if compromised See `mapbox-token-security` skill for comprehensive token security guidance. ### 5. Update Map Initialization ```javascript // Before (MapLibre) const map = new maplibregl.Map({ container: 'map', style: 'https://demotiles.maplibre.org/style.json', // or your custom style center: [-122.4194, 37.7749], zoom: 12 }); // After (Mapbox) mapboxgl.accessToken = 'pk.your_mapbox_access_token'; const map = new mapboxgl.Map({ container: 'map', style: 'mapbox://styles/mapbox/standard', // Mapbox style center: [-122.4194, 37.7749], zoom: 12 }); ``` ### 6. Update Style URL Mapbox provides professionally designed, maintained styles: ```javascript // Mapbox built-in styles style: 'mapbox://styles/mapbox/standard'; // Mapbox Standard (default) style: 'mapbox://styles/mapbox/standard-satellite'; // Mapbox Standard Satellite style: 'mapbox://styles/mapbox/streets-v12'; // Streets v12 style: 'mapbox://styles/mapbox/satellite-v9'; // Satellite imagery style: 'mapbox://styles/mapbox/satellite-streets-v12'; // Hybrid style: 'mapbox://styles/mapbox/outdoors-v12'; // Outdoor/recreation style: 'mapbox://styles/mapbox/light-v11'; // Light theme style: 'mapbox://styles/mapbox/dark-v11'; // Dark theme style: 'mapbox://styles/mapbox/navigation-day-v1'; // Navigation (day) style: 'mapbox://styles/mapbox/navigation-night-v1'; // Navigation (night) ``` **Custom styles:** You can also create and use custom styles from Mapbox Studio: ```javascript style: 'mapbox://styles/your-username/your-style-id'; ``` ### 7. Update All References Replace all `maplibregl` references with `mapboxgl`: ```javascript // Markers const marker = new mapboxgl.Marker() // was: maplibregl.Marker() .setLngLat([-122.4194, 37.7749]) .setPopup(new mapboxgl.Popup().setText('San Francisco')) .addTo(map); // Controls map.addControl(new mapboxgl.NavigationControl(), 'top-right'); map.addControl(new mapboxgl.GeolocateControl()); map.addControl(new mapboxgl.FullscreenControl()); map.addControl(new mapboxgl.ScaleControl()); ``` ### 8. Update Plugins (If Used) Some MapLibre plugins should be replaced with Mapbox versions: | MapLibre Plugin | Mapbox Alternative | | -------------------------------- | ---------------------------- | | `@maplibre/maplibre-gl-geocoder` | `@mapbox/mapbox-gl-geocoder` | | `@maplibre/maplibre-gl-draw` | `@mapbox/mapbox-gl-draw` | | `maplibre-gl-compare` | `mapbox-gl-compare` | Example: ```javascript // Before (MapLibre) import MaplibreGeocoder from '@maplibre/maplibre-gl-geocoder'; // After (Mapbox) import MapboxGeocoder from '@mapbox/mapbox-gl-geocoder'; map.addControl( new MapboxGeocoder({ accessToken: mapboxgl.accessToken, mapboxgl: mapboxgl }) ); ``` ### 9. Everything Else Stays the Same All your map code, events, layers, and sources work identically: ```javascript // This code works EXACTLY THE SAME in both libraries map.on('load', () => { map.addSource('points', { type: 'geojson', data: geojsonData }); map.addLayer({ id: 'points-layer', type: 'circle', source: 'points', paint: { 'circle-radius': 8, 'circle-color': '#ff0000' } }); }); // Events work identically map.on('click', 'points-layer', (e) => { console.log(e.features[0].properties);
Related in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.