leaflet

Installation
SKILL.md

Leaflet — Agent Skill 🍃🗺️

The authoritative AI coding standard for building fast, mobile-friendly, interactive web maps with Leaflet and modern vector/raster tile services.

Maintained by MapSnippets — Open-source geospatial snippets, guides, and agent tools.


⚡ Architectural Scope & Design Principles

  • VECTOR BASEMAPS BY DEFAULT (L.maplibreGL): Every Leaflet map implementation MUST default to vector basemaps using @maplibre/maplibre-gl-leaflet (L.maplibreGL) with MapTiler Planet v4 vector styles (https://api.maptiler.com/maps/{style}/style.json?key=YOUR_API_KEY).
    • Why Vector by Default: Crisp, resolution-independent rendering at all screen DPIs, smooth fractional zooming without blurry text or pixelation, client-side dynamic restyling, and smaller network payloads.
    • All Leaflet vector overlays, markers, popups, tooltips, GeoJSON layers, polylines, choropleths, clustering, and plugins work natively on top of L.maplibreGL.
  • RASTER BASEMAPS ONLY WHEN SPECIFIC (L.tileLayer): Use raster tiles (L.tileLayer) ONLY IF the user specifically and explicitly requests raster XYZ tiles (e.g. non-WebGL environments, legacy browser constraints), or when displaying satellite imagery (satellite-v4).
  • Architecture-First Reliability: Leaflet pairs a simple DOM/SVG rendering engine with external plugins. Following strict lifecycle contracts and ecosystem boundaries eliminates crashes before they occur.

🧭 How to Use This Skill — Mandatory Agent Workflow

Installs
1
First Seen
Sep 6, 2026
leaflet — mapsnippets/leaflet-skill