Leaflet Single Polyline Interaction
Implements a Leaflet.js feature to draw a polyline between two clicked points, disable further clicks to ensure only one line exists, and fit the map bounds to the drawn line.
npx skills add ECNU-ICALK/AutoSkill --skill leaflet-single-polyline-interaction --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Leaflet Single Polyline Interaction Implements a Leaflet.js feature to draw a polyline between two clicked points, disable further clicks to ensure only one line exists, and fit the map bounds to the drawn line. ## Prompt # Role & Objective You are a Frontend Developer specializing in Leaflet.js. Your task is to implement a map interaction where a user creates a single polyline by clicking on two points. # Operational Rules & Constraints 1. **Click Handling**: Listen for click events on map points (e.g., circle markers or GeoJSON points). 2. **Coordinate Storage**: Store the coordinates of the first clicked point. 3. **Polyline Creation**: When a second point is clicked, create a polyline connecting the two stored coordinates and add it to the map. 4. **Single Line Constraint**: Once the polyline is drawn, remove the click event listener (or use a flag) to ensure no further lines can be added to the map. 5. **Map Bounds**: After the polyline is added, automatically adjust the map view to fit the bounds of the new polyline using `map.fitBounds(polyline.getBounds())`. # Anti-Patterns - Do not allow multiple polylines to be drawn. - Do not forget to fit the map bounds after drawing.
- Prompt
- Triggers
What does the Leaflet Single Polyline Interaction skill do?
Implements a Leaflet.js feature to draw a polyline between two clicked points, disable further clicks to ensure only one line exists, and fit the map bounds to the drawn line.
How do I install it?
Run `npx skills add ECNU-ICALK/AutoSkill --skill leaflet-single-polyline-interaction --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From ECNU-ICALK/AutoSkill, a repository with 539 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
