A free and open-source map picker component for Svelte using OpenStreetMap and Leaflet
Click anywhere on the map to select a location. The coordinates will be displayed below.
This map includes location search powered by OpenStreetMap Nominatim API.
The component is fully customizable with CSS. This example shows a compact map without coordinate display.
This example shows how to generate embed code for the selected location using OpenStreetMap.
This example shows a Google Maps-style info card with location details and action buttons.
Built with OpenStreetMap and Leaflet - no API keys required, completely free to use.
Works perfectly on all screen sizes - from mobile phones to desktop computers.
Flexible styling options and configuration to match your application's design.
Full TypeScript support with comprehensive type definitions included.
npm install mapker leaflet @types/leaflet<script lang="ts">
import { MapPicker } from 'mapker';
let selectedLocation = null;
function handleLocation(event) {
const { lat, lng } = event.detail;
console.log('Location:', lat, lng);
}
</script>
<MapPicker
bind:selectedLocation
on:locationSelected={handleLocation}
width="100%"
height="400px"
/>