leaflet_cost_validated_map_placement_with_bounds
Implements a workflow where a user triggers placement via a button, validates a cost condition, draws a polyline and marker from a fixed start point, deducts…
от ECNU-ICALK★ 623 звезды на GitHub
Установить leaflet_cost_validated_map_placement_with_bounds в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
leaflet_cost_validated_map_placement_with_bounds
Implements a workflow where a user triggers placement via a button, validates a cost condition, draws a polyline and marker from a fixed start point, deducts the cost, fits the map bounds to the new feature, and cleans up event listeners.
Prompt
Role & Objective
Act as a JavaScript/Leaflet.js developer. Implement a map interaction workflow where a user triggers a placement mode via a button, clicks the map to place an item (polyline and marker), subject to a cost validation check, and automatically adjusts the map view to fit the new feature.
Operational Rules & Constraints
- Trigger: Set up an event listener on a specific button (e.g., ID 'newStation').
- Map Interaction: When the button is clicked, attach a
clickevent listener to the map object. - Validation: Inside the map click handler, check a condition (e.g.,
money <= <NUM>) before proceeding. - Visuals:
- Create a
L.polylineconnecting a fixed start coordinate (e.g.,secondCityCoords) to the clicked location (e.latlng). - Create a
L.circleMarkerat the clicked location. - Bounds Fitting: After adding the polyline, set the map bounds to fit the area of the polyline using
map.fitBounds(polyline.getBounds()).
- Create a
- State Update: Deduct the cost from the money variable (e.g.,
money -= <NUM>). - Cleanup: Remove the map click event listener immediately after the item is placed using
map.off('click', handlerFunction). - Marker Interaction: Add a click event listener to the newly created marker to log a message to the console.
Anti-Patterns
- Do not leave the map click listener active after placement.
- Do not perform the action if the cost validation fails.
- Do not forget to fit the map bounds after drawing the polyline.
Triggers
- add a station to the map
- leaflet interaction with money check
- draw polyline and marker on click
- implement map placement workflow
- set the map bounds after the polyline is added
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл leaflet_cost_validated_map_placement_with_bounds?
Implements a workflow where a user triggers placement via a button, validates a cost condition, draws a polyline and marker from a fixed start point, deducts the cost, fits the map bounds to the new feature, and cleans up event listeners.
Как установить скилл leaflet_cost_validated_map_placement_with_bounds?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл leaflet_cost_validated_map_placement_with_bounds запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
AnthropicToolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
access
AnthropicManage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
configure
AnthropicSet up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
access
AnthropicManage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…