← Back to Skills Marketplace
jvy

leaflet

by jvy · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
156
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install leaflet
Description
Build, debug, and integrate Leaflet web maps, including map setup, tile layers, markers, popups, GeoJSON overlays, bounds fitting, event handling, and plugin...
README (SKILL.md)

Leaflet

Use this skill for practical 2D web map work with Leaflet.

Leaflet is best for lightweight interactive maps that need simple setup, raster or XYZ tile layers, GeoJSON overlays, and straightforward custom controls. It is usually the right choice when the user wants a dependable browser map without the heavier rendering model of WebGL-first stacks.

Workflow

  1. Confirm the runtime first:
    • plain HTML
    • Vite
    • React
    • Next.js or another SPA framework
  2. Confirm the actual map job:
    • base map only
    • markers and popups
    • GeoJSON overlay
    • choropleth or feature styling
    • draw/edit interaction
    • bug fixing or migration
  3. Start from the smallest visible map before adding controls, overlays, clustering, or plugins.
  4. Check container size and CSS before debugging data or tile logic.
  5. Keep data CRS assumptions explicit; Leaflet usually expects WGS84 longitude/latitude input for GeoJSON-style work.

Implementation Guardrails

  • Ensure the map container has a real height before initializing the map.
  • Use L.map(...) once per container and clean it up in SPA teardown paths.
  • Fit bounds from real data instead of hardcoding zoom/center when the dataset is dynamic.
  • Prefer L.geoJSON(...) for lightweight vector overlays and feature-level styling.
  • Keep tile URLs configurable and attribute them correctly.
  • Use clustering or canvas-based rendering when marker counts grow large.
  • Treat plugins as optional dependencies; verify maintenance status and compatibility before adopting them.

Common Failure Checks

  • Blank map: verify container height, CSS import, tile URL, and network access.
  • Tiles not loading: verify URL template, attribution requirements, CORS behavior, and rate limits.
  • Features in the wrong place: verify coordinate order and whether the source data is really WGS84 lon/lat.
  • Map rendering oddly after resize or tab switch: call map.invalidateSize() after the container becomes visible.
  • Memory leaks in React or SPA routes: remove the map instance and detach listeners on teardown.
  • Slow interaction with many points: cluster points, simplify GeoJSON, or switch from DOM-heavy markers to canvas-friendly rendering.

Practical Patterns

Minimal map

  • Create the map only after the container exists.
  • Add one tile layer with attribution.
  • Set a sane initial center/zoom or fit to bounds from data.

GeoJSON overlay

  • Use L.geoJSON with explicit style and onEachFeature.
  • Keep popup content deterministic and escape or sanitize user-provided text.
  • Fit to the resulting layer bounds when the overlay is the main subject.

Interactive app integration

  • Store the map instance outside repeated render loops.
  • Update layers incrementally instead of recreating the entire map on every state change.
  • Separate base layer setup from data overlay updates.

Drawing and editing

  • Use a maintained drawing plugin only when the user explicitly needs editing.
  • Confirm output format, CRS assumptions, and persistence flow before wiring edit tools.

Task Boundaries

  • Use this skill for Leaflet-specific implementation, debugging, and integration patterns.
  • For CRS and reprojection decisions, use project or wgs84.
  • For China-specific CGCS2000 reasoning, use cgcs2000.
  • For file-based GIS conversion or batch reprojection, use qgis.
  • For Mapbox GL JS or vector-tile style expressions, use mapbox.
  • For CesiumJS globe rendering, use cesium.

What To Return

  • A minimal working Leaflet setup or a targeted fix.
  • The likely root cause when debugging a broken map.
  • Clear notes on tile source assumptions, coordinate order, and CRS constraints.
  • Any required cleanup or lifecycle handling for the framework in use.
  • A smaller reproducible example first if the original integration is too noisy.

OpenClaw + ClawHub Notes

  • Keep examples generic, portable, and safe to paste into local projects.
  • Do not hardcode private tile servers, private tokens, or machine-specific paths.
  • Prefer maintained public dependencies and standards-based examples.
  • For clawhub.ai publication, keep examples reproducible and version/changelog updates semver-driven.

Reference Docs In This Skill

  • Read {baseDir}/references/patterns.md when generating or fixing Leaflet code for vanilla HTML, Vite, React, or GeoJSON-heavy pages.
Usage Guidance
This skill is instruction-only and appears coherent and low-risk: it doesn't request secrets, install code, or access system paths. Before using, review any generated code for external tile URLs and third-party plugin usage (verify licensing, attribution, rate limits and whether a provider requires a private token). Never paste private API keys or machine-specific paths into prompts; if you need private tiles or tokens, keep them out of shared examples and restrict them to your application configuration. Finally, vet any suggested third-party plugins for maintenance and security before adding them to production.
Capability Analysis
Type: OpenClaw Skill Name: leaflet Version: 1.0.0 The 'leaflet' skill bundle is a well-structured set of instructions and patterns for an AI agent to assist with Leaflet web map development. It contains standard implementation guardrails, debugging checklists, and framework-specific integration advice (SKILL.md, patterns.md) without any evidence of malicious intent, data exfiltration, or harmful prompt injection.
Capability Assessment
Purpose & Capability
The name and description match the SKILL.md guidance: building, debugging, and integrating Leaflet maps. Nothing in the skill asks for unrelated binaries, credentials, or system access.
Instruction Scope
Runtime instructions focus on map setup, debugging heuristics, framework lifecycle, CRS guidance, and safe popup/content handling. The skill does not instruct the agent to read system files, access unrelated environment variables, or transmit data to hidden endpoints. It explicitly warns not to hardcode private tokens.
Install Mechanism
No install specification and no code files — this is instruction-only, so nothing is downloaded or written to disk by the skill itself.
Credentials
No required environment variables, credentials, or config paths are declared. The skill's guidance about tile URLs and attributions is appropriate for a mapping helper.
Persistence & Privilege
always is false and there are no elevated privileges requested. The agents/openai.yaml allows implicit invocation (allow_implicit_invocation: true), which is a normal platform setting and not a disproportionate privilege for this skill.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install leaflet
  3. After installation, invoke the skill by name or use /leaflet
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Initial release of the Leaflet skill: - Provides guidance for building, debugging, and integrating Leaflet web maps. - Covers map setup, tile layers, markers, popups, GeoJSON overlays, event handling, plugin patterns, and common failure checks. - Supports integration with vanilla HTML, Vite, React, and other frontend frameworks. - Includes practical patterns for minimal maps, GeoJSON overlays, interactive apps, and drawing/editing scenarios. - Outlines clear task boundaries and best practices for reliable web map implementation.
Metadata
Slug leaflet
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is leaflet?

Build, debug, and integrate Leaflet web maps, including map setup, tile layers, markers, popups, GeoJSON overlays, bounds fitting, event handling, and plugin... It is an AI Agent Skill for Claude Code / OpenClaw, with 156 downloads so far.

How do I install leaflet?

Run "/install leaflet" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is leaflet free?

Yes, leaflet is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does leaflet support?

leaflet is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created leaflet?

It is built and maintained by jvy (@jvy); the current version is v1.0.0.

💬 Comments