map-layer-add

Add a toggleable proxy overlay module to a Leaflet map.

55|1|Updated Apr 18, 2026
One-click install
npx skills add https://github.com/MrSuttonmann/flightjar --skill map-layer-add
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: map-layer-add
Source: https://github.com/MrSuttonmann/flightjar/tree/main/.claude/skills/map-layer-add
Command: npx skills add https://github.com/MrSuttonmann/flightjar --skill map-layer-add

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This pattern provides a structured approach to adding new, toggleable overlays to a Leaflet map, wiring the layers control, persistence, and keyboard interactions without duplicating boilerplate.

Core Features & Use Cases

  • Proxy overlay: overlay logic resides in a dedicated module that fetches and renders data, exposes a setX(on) interface, and manages its own layerGroup.
  • Tile overlay: overlay is a simple L.tileLayer for raster sources with Leaflet's built-in lifecycle.
  • Use Case: ideal for weather radar, flight paths, wind barbs, METAR stations, MLAT coverage, or custom GeoJSON overlays.

Quick Start

Create a new proxy overlay module and wire it into map_setup.js and initMap as described, then toggle it via the map layers control.

Frequently Asked Questions about map-layer-add

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a toggleable overlay to a Leaflet map?

To add a toggleable overlay to a Leaflet map, create a dedicated proxy overlay module implementing a setX(on) interface, then register it in map_setup.js using the PROXY_OVERLAYS configuration and wire it into your initMap setup.

What is the proxy overlay pattern in Leaflet web mapping?

The proxy overlay pattern in Leaflet web mapping places overlay logic in a dedicated module that fetches and renders data, manages its own layerGroup, and exposes a setX(on) interface, preventing boilerplate duplication when wiring layers control and persistence.

How do I persist map overlay visibility state in localStorage?

Persisting map overlay visibility state in localStorage is handled automatically by the proxy overlay pattern during the map setup lifecycle, ensuring your weather radar or flight path toggle preferences remain active across user sessions.

Can I use this overlay pattern for custom GeoJSON and weather radar layers?

Yes, the overlay pattern supports custom GeoJSON and weather radar layers by utilizing either a proxy overlay for complex data fetching or a simple L.tileLayer for raster sources, integrating both seamlessly into the layers control.

Does adding a Leaflet map overlay require backend endpoints?

Adding a Leaflet map overlay can include optional backend endpoints depending on your data source, though simple raster tile overlays using L.tileLayer rely entirely on Leaflet's built-in lifecycle without needing custom server routes.

How do I add keyboard shortcuts to toggle map layers in JavaScript?

Keyboard shortcuts to toggle map layers in JavaScript are configured as an optional feature during the proxy overlay registration in map_setup.js, allowing users to quickly switch overlays like wind barbs or flight paths.