Skip to main content
skill CX Codex

mapbox-style-patterns — Claude Code skill: Mapbox style recipes

Ready-made Mapbox layer setups for common maps: POI finders, real estate, navigation, delivery. Useful when you want a proven style instead of picking colors from scratch.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add mapbox/mapbox-agent-skills --skill mapbox-style-patterns -a claude-code
Open on GitHub

What mapbox-style-patterns does

The skill ships a library of map style patterns. The first one is written out in full: a restaurant and POI finder. It lists layers for background, water, parks, minor and major roads, plus markers with labels. The base map stays desaturated so it does not fight with photos, markers are high contrast, and labels get a halo for readability.

The other scenarios live in separate files under references/: real estate with property boundaries and price color-coding, a minimal grayscale base for choropleth and heatmap overlays, navigation with routes and turn arrows, a dark theme, and delivery tracking with zones. There are also files on clustering dense points, 3D buildings, terrain, and a breakdown of how addInteraction, setFeatureState and appearances fit together.

A decision tree walks you through four questions: what the primary content is, where the map is viewed, what the user's main action is, and whether the target is mobile or desktop. One pattern shows how to thin out roads by zoom with a step filter. The recipes assume Mapbox Streets, so check the source and layer names against your own style — otherwise the class filters will match nothing.

What it helps with

  • build a map style for a restaurant or POI finder
  • show property boundaries colored by price
  • set up a grayscale base for a choropleth or heatmap
  • draw a route with turn arrows
  • add delivery tracking and zones to a map

Example prompts for the agent

  • Build a restaurant finder map style using the POI Finder pattern
  • I need a dark map theme — use the Dark Mode pattern
  • Add clustering for dense points on the map

How to install mapbox-style-patterns

1Skills CLI (Vercel)

npx skills add mapbox/mapbox-agent-skills --skill mapbox-style-patterns -a claude-code

2Manually: put the files in place

~/.claude/skills/mapbox-style-patterns/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/mapbox-style-patterns/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about mapbox-style-patterns

How do I install mapbox-style-patterns in Claude?

Run npx skills add mapbox/mapbox-agent-skills --skill mapbox-style-patterns -a claude-code. The skill file then sits at ~/.claude/skills/mapbox-style-patterns/SKILL.md.

What does mapbox-style-patterns do?

It provides ready layer configurations and styles for typical mapping scenarios: POI finders, real estate, data visualization, navigation, delivery. It also includes a pattern selection tree and zoom-based layer simplification.

Does the skill need a Mapbox API key?

The skill describes styles and layers rather than calling the service. Data comes from the mapbox-streets source, so your style and layer names need to match the ones used in the patterns.

Source text

SKILL.md · MIT
---
name: mapbox-style-patterns
description: Common style patterns, layer configurations, and recipes for typical mapping scenarios including restaurant finders, real estate, data visualization, navigation, delivery/logistics, and more. Use when implementing specific map use cases or looking for proven style patterns.
---

# Mapbox Style Patterns Skill

This skill provides battle-tested style patterns and layer configurations for common mapping scenarios.

## Pattern Library

### Pattern 1: Restaurant/POI Finder

**Use case:** Consumer app showing restaurants, cafes, bars, or other points of interest

**Visual requirements:**

- POIs must be immediately visible
- Street context for navigation
- Neutral background (photos/content overlay)
- Mobile-optimized

**Recommended layers:**

```json
{
  "layers": [
    {
      "id": "background",
      "type": "background",
      "paint": {
        "background-color": "#f5f5f5"
      }
    },
    {
      "id": "water",
      "type": "fill",
      "source": "mapbox-streets",
      "source-layer": "water",
      "paint": {
        "fill-color": "#d4e4f7",
        "fill-opacity": 0.6
      }
    },
    {
      "id": "landuse-parks",
      "type": "fill",
      "source": "mapbox-streets",
      "source-layer": "landuse",
      "filter": ["==", "class", "park"],
      "paint": {
        "fill-color": "#e8f5e8",
        "fill-opacity": 0.5
      }
    },
    {
      "id": "roads-minor",
      "type": "line",
      "source": "mapbox-streets",
      "source-layer": "road",
      "filter": ["in", "class", "street", "street_limited"],
      "paint": {
        "line-color": "#e0e0e0",
        "line-width": {
          "base": 1.5,
          "stops": [
            [12, 0.5],
            [15, 2],
            [18, 6]
          ]
        }
      }
    },
    {
      "id": "roads-major",
      "type": "line",
      "source": "mapbox-streets",
      "source-layer": "road",
      "filter": ["in", "class", "primary", "secondary", "tertiary"],
      "paint": {
        "line-color": "#ffffff",
        "line-width": {
          "base": 1.5,
          "stops": [
            [10, 1],
            [15, 4],
            [18, 12]
          ]
        }
      }
    },
    {
      "id": "restaurant-markers",
      "type": "symbol",
      "source": "restaurants",
      "layout": {
        "icon-image": "restaurant-15",
        "icon-size": 1.5,
        "icon-allow-overlap": false,
        "text-field": ["get", "name"],
        "text-offset": [0, 1.5],
        "text-size": 12,
        "text-allow-overlap": false
      },
      "paint": {
        "icon-color": "#FF6B35",
        "text-color": "#333333",
        "text-halo-color": "#ffffff",
        "text-halo-width": 2
      }
    }
  ]
}
```

**Key features:**

- Desaturated base map (doesn't compete with photos)
- High-contrast markers (#FF6B35 orange stands out)
- Clear road network (white on light gray)
- Parks visible but subtle
- Text halos for readability

## Pattern Selection Guide

### Decision Tree

**Question 1: What is the primary content?**

- User-generated markers/pins -> **POI Finder Pattern**
- Property data/boundaries -> **Real Estate Pattern**
- Statistical/analytical data -> **Data Visualization Pattern**
- Routes/directions -> **Navigation Pattern**
- Real-time tracking/delivery zones -> **Delivery/Logistics Pattern** (customer markers should include a pulse animation via second circle layer + requestAnimationFrame + setPaintProperty; see references/delivery-logistics.md)

**Question 2: What is the viewing environment?**

- Daytime/office -> Light theme
- Night/dark environment -> **Dark Mode Pattern**
- Variable -> Provide theme toggle

**Question 3: What is the user's primary action?**

- Browse/explore -> Focus on POIs, rich detail
- Navigate -> Focus on roads, route visibility
- Track delivery/logistics -> Real-time updates, zones, status
- Analyze data -> Minimize base map, maximize data
- Select location -> Clear boundaries, context

**Question 4: What is the platform?**

- Mobile -> Simplified, larger touch targets, less detail
- Desktop -> Can include more detail and complexity
- Both -> Design mobile-first, enhance for desktop

## Layer Optimization Patterns

### Performance Pattern: Simplified by Zoom

```json
{
  "id": "roads",
  "type": "line",
  "source": "mapbox-streets",
  "source-layer": "road",
  "filter": [
    "step",
    ["zoom"],
    ["in", "class", "motorway", "trunk"],
    8,
    ["in", "class", "motorway", "trunk", "primary"],
    12,
    ["in", "class", "motorway", "trunk", "primary", "secondary"],
    14,
    true
  ],
  "paint": {
    "line-width": {
      "base": 1.5,
      "stops": [
        [4, 0.5],
        [10, 1],
        [15, 4],
        [18, 12]
      ]
    }
  }
}
```

## Reference Files

Additional patterns and configurations are available in the `references/` directory. Load the relevant file when a specific pattern is needed.

| File                                                                         | Contents                                                                                             |
| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
| [references/real-estate.md](references/real-estate.md)                       | Pattern 2: Real Estate Map -- property boundaries, price color-coding, amenity markers               |
| [references/data-viz-base.md](references/data-viz-base.md)                   | Pattern 3: Data Visualization Base Map -- minimal grayscale base for choropleth/heatmap overlays     |
| [references/navigation.md](references/navigation.md)                         | Pattern 4: Navigation/Routing Map -- route display, user location, turn arrows                       |
| [references/dark-mode.md](references/dark-mode.md)                           | Pattern 5: Dark Mode / Night Theme -- near-black background, reduced brightness                      |
| [references/delivery-logistics.md](references/delivery-logistics.md)         | Pattern 6: Delivery/Logistics Map -- real-time tracking, zones, driver markers, ETA badges           |
| [references/expressions-clustering.md](references/expressions-clustering.md) | Data-driven expression patterns + clustering for dense POIs                                          |
| [references/common-modifications.md](references/common-modifications.md)     | 3D Buildings, Terrain/Hillshade, Custom Markers                                                      |
| [references/interactions.md](references/interactions.md)                     | `addInteraction` vs `setFeatureState` vs `appearances` -- how they fit together and when to use each |

**Loading instructions:** Read the reference file that matches the user's use case. For example, if implementing a delivery tracking map, load `references/delivery-logistics.md`.

## Testing Patterns

### Visual Regression Checklist

- [ ] Test at zoom levels: 4, 8, 12, 16, 20
- [ ] Verify on mobile (375px width)
- [ ] Verify on desktop (1920px width)
- [ ] Test with dense data
- [ ] Test with sparse data
- [ ] Check label collision
- [ ] Verify color contrast (WCAG)
- [ ] Test loading performance

## When to Use This Skill

Invoke this skill when:

- Starting a new map style for a specific use case
- Looking for layer configuration examples
- Implementing common mapping patterns
- Optimizing existing styles
- Need proven recipes for typical scenarios
- Debugging style issues
- Learning Mapbox style best practices

© mapbox · MIT · mapbox/mapbox-agent-skills

Similar skills

Everything for Frontend and UI →

From the same set18

mapbox-web-integration-patterns Official Mapbox GL JS integration patterns for React, Vue, Svelte, Angular and vanilla JavaScript. Useful when a map leaks memory or refuses to initialize in the right hook. CX Codex +1 2,600installs mapbox-web-performance-patterns Mapbox GL JS performance skill that eliminates initialization waterfalls, shrinks style bundles, and replaces sluggish DOM markers with GPU layers. CX Codex +1 2,500installs mapbox-geospatial-operations A skill that helps your agent choose between Turf.js geometric math and Mapbox routing APIs. Useful when a task involves distances, zones or routes. CX Codex +1 2,200installs mapbox-cartography A skill that feeds your agent cartographic rules: layer hierarchy, color palettes, typography and zoom strategy for Mapbox styles. CX Codex +1 2,100installs mapbox-data-visualization-patterns Data visualization patterns for Mapbox GL JS in Claude Code, covering choropleth maps, heatmaps, and 3D styling. Helpful when plotting statistical data or point densities. CX Codex +1 2,100installs mapbox-style-quality A skill that walks your agent through Mapbox style QA: expression and GeoJSON validation, WCAG contrast checks, and style optimization. CX Codex +1 2,000installs mapbox-search-integration Walks your agent through the full Mapbox search rollout: discovery questions first, then a working integration with the right API and parameters. CX Codex +1 1,900installs mapbox-token-security Security guidelines for Mapbox access tokens: scope management, URL restrictions, and client initialization guards. CX Codex +1 1,900installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor