All skills
mapbox avatar

/mapbox-cartography

@7cac917 official
by mapboxmapbox/mapbox-agent-skills80 stars
17

Expert guidance on map design principles, color theory, visual hierarchy, typography, and cartographic best practices for creating effective and beautiful maps with Mapbox. Use when designing map styles, choosing colors, or making cartographic decisions.

Use this Skill: https://skilld.dev/gh/mapbox/mapbox-agent-skills/mapbox-cartography

This session only. Nothing lands on disk.

AGENTS.md

≈1.3k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Mapbox Cartography Principles

Quick reference for map design, color theory, visual hierarchy, and accessibility.

Core Cartography Principles

1. Visual Hierarchy

Most Important Rule: Direct user attention to what matters most.

Priority levels:

  • Primary: Main features (roads, labels for user's task)
  • Secondary: Supporting context (water, parks)
  • Tertiary: Background (minor roads, less important labels)

Tools:

  • Size: Larger = more important
  • Color: Brighter/saturated = more important
  • Contrast: Higher contrast = more important
  • Position: Foreground > Background

2. Figure-Ground Relationship

Make primary features stand out from background:

// ✅ Good contrast between features and background
'background': '#f8f8f8',     // Light gray
'water': '#a8d5ff',          // Distinct blue
'roads': '#ffffff',          // Bright white
'labels': '#333333'          // Dark text

3. Color Theory

Color Schemes:

  • Sequential: Light → Dark (population density, elevation)
  • Diverging: Low ← Neutral → High (temperature, sentiment)
  • Categorical: Distinct colors for categories (never more than 7-8)

Rules:

  • Limit palette to 5-7 colors maximum
  • Use ColorBrewer for data visualization
  • Test for colorblindness (deuteranopia most common)
  • Avoid red/green combinations

4. Label Hierarchy

Typography sizing:

// Cities by population
'text-size': [
  'interpolate', ['linear'], ['zoom'],
  4, ['match', ['get', 'type'],
    'capital', 16,
    'city', 12,
    'town', 10,
    8
  ]
]

Label placement rules:

  • Cities: Above point
  • Roads: Along line
  • Areas: Inside polygon
  • Avoid label collisions (use text-allow-overlap: false)

Color Best Practices

Accessible Color Contrast

WCAG 2.1 Standards:

  • Normal text: 4.5:1 contrast ratio
  • Large text: 3:1 contrast ratio
  • Essential graphics: 3:1 contrast ratio
// ✅ Good contrast for labels
'text-color': '#333333',     // Dark text
'text-halo-color': '#ffffff', // White halo
'text-halo-width': 2

Colorblind-Safe Palettes

Avoid:

  • ❌ Red/Green (deuteranopia)
  • ❌ Blue/Yellow (tritanopia)
  • ❌ Pure color differentiation

Use:

  • ✅ Pattern/texture in addition to color
  • ✅ Labels for categories
  • ✅ Size/shape variations
  • ✅ Colorblind-safe palettes (ColorBrewer)

Typography

Font Selection

Mapbox fonts:

  • Roboto: Clean, modern, web-optimized
  • Open Sans: Highly legible, good for labels
  • DIN Pro: Professional, geometric
  • Montserrat: Elegant headlines

Rules:

  • Max 2 font families per map
  • Use font-weight for hierarchy
  • Sans-serif for UI, optional serif for labels

Label Sizing

Base sizes:

'text-size': [
  'interpolate', ['linear'], ['zoom'],
  8, 10,    // Small at low zoom
  12, 14,   // Medium at mid zoom
  16, 18    // Large at high zoom
]

Data Visualization

Choropleth Maps

For area data (population, income, etc.):

// ✅ Use sequential colors
'fill-color': [
  'step',
  ['get', 'density'],
  '#f7fbff',  // Light
  10, '#deebf7',
  20, '#c6dbef',
  50, '#9ecae1',
  100, '#6baed6',
  200, '#3182bd',
  500, '#08519c'  // Dark
]

Rules:

  • 5-7 data classes maximum
  • Equal intervals or quantiles
  • Include legend
  • Show data source

Proportional Symbols

For point data (city size, counts):

// ✅ Scale circle size by value
'circle-radius': [
  'interpolate', ['linear'], ['get', 'population'],
  0, 5,           // Min: 5px
  100000, 15,     // Mid: 15px
  1000000, 30     // Max: 30px
]

Map Styles by Use Case

Navigation/Wayfinding

  • Emphasize: Roads, labels, route
  • De-emphasize: Buildings, terrain
  • Colors: High contrast, clear hierarchy

Data Visualization

  • Emphasize: Data layer, legend
  • De-emphasize: Base map (grayscale)
  • Colors: Data-appropriate palette

Storytelling

  • Emphasize: Story points, annotations
  • De-emphasize: Irrelevant features
  • Colors: Support narrative mood

Reference Map

  • Balanced: All features proportionate
  • Clear: Good labels, readable
  • Colors: Conventional (blue water, green parks)

Quick Design Checklist

✅ Clear visual hierarchy (primary features stand out) ✅ Limited color palette (5-7 colors max) ✅ Accessible contrast ratios (4.5:1 for text) ✅ Colorblind-safe colors (avoid red/green alone) ✅ Appropriate label sizes (scales with zoom) ✅ No label collisions (readable at all zooms) ✅ Legend included (for data visualization) ✅ Consistent styling (similar features look similar) ✅ Tested at multiple zoom levels ✅ Mobile-friendly (tap targets, text size)

Common Mistakes

❌ Too many colors (>7 categories) ❌ Poor contrast (low visibility) ❌ Red/green combinations (colorblind users) ❌ Small text without halos (illegible) ❌ Cluttered labels (overlapping) ❌ Inconsistent styling (confusing) ❌ No legend (data maps unclear) ❌ Ignoring zoom levels (too much/little detail)

Source: SKILL.md on GitHub

No alerts16d5 checks · Risk SAFE
  • Gen Agent Trust Hub16d

    The skill contains cartographic design documentation and guidelines for Mapbox. No security vulnerabilities, malicious patterns, or executable code risks were detected.

  • Socket16d

    No alerts

  • Snyk16d

    Risk: LOW · No issues

  • Runlayer6mo

    2 files scanned · No issues

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 7cac917. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 5 hours ago.

Activeupdated 6 months ago
  • mapbox
  • cartography
  • map-design
  • color-theory
  • typography
  • visual-hierarchy
  • accessibility
  • dark-mode

README badge

README badge for mapbox/mapbox-agent-skills/mapbox-cartography

Provides cartographic guidance for designing map styles with Mapbox, covering visual hierarchy, color theory, typography, and zoom-level strategies. Use when choosing colors, establishing layer ordering, ensuring accessibility, or optimizing for specific use cases like navigation or data visualization.

Generated from the current SKILL.md.

Does this skill help with Mapbox GL JS implementation details?
No. This skill focuses on cartographic design principles, color theory, and visual hierarchy for maps. For Mapbox GL JS API usage, styling layer syntax, or performance tuning, refer to the Mapbox documentation or other technical skills.
What color palettes does this skill provide?
The skill includes four ready-to-use palettes: light theme, dark theme, high contrast for accessibility, and vintage/retro. Each specifies colors for background, water, parks, roads, buildings, and text.
Does this skill address mobile map design?
Yes. The skill covers platform-specific considerations including mobile touch targets (44x44px minimum), simpler designs for mobile, and larger text for arm's-length readability.
How does this skill recommend handling POIs and user content in layer ordering?
User-generated content like routes and markers should render above everything, including POI symbols, to ensure user data is never obscured by base map elements.
Does this skill provide guidance for colorblind accessibility?
Yes. The skill recommends a 4.5:1 contrast ratio for text, avoiding red/green combinations for critical distinctions, and testing designs with colorblind simulators.

Generated from the current SKILL.md. These answers refresh after source changes.