svelte-pick-a-place
- A Svelte component for position and area selection using Leaflet
- Allows users to click on a map to select a position or draw a polygon area
- Emits
updateandsaveevents with the selected geometry in GeoJSON format - Supports both modern Svelte apps and legacy JavaScript applications
Key Features:
- Supports point and polygon selection modes (configurable via
selectionModesprop) - Includes interactive guide overlay with instructions
- Provides cancel and save buttons
- Accepts initial selection through GeoJSON feature
- Responsive design that fills parent container
Target Audience:
- Svelte developers needing map-based location/area selection
- Developers building applications with geographic data input
- Projects requiring integration with Leaflet maps
Framework Support:
- Primarily designed for Svelte applications
- Also provides standalone JavaScript API for legacy applications
Demo Examples:
Event System:
update: Triggered when selection changes (returns GeoJSON feature)save: Triggered on save button click (returns GeoJSON feature)cancel: Triggered on cancel button click
Note: The component requires a Leaflet instance to be passed via the leaflet prop.
sveltelocationleaflet
Featured Stories
No featured articles.