| Install | |
|---|---|
composer require salemaljebaly/filament-map-picker |
|
| Latest Version: | v1.0.3 |
| PHP: | ^8.2 |
A simple, polished Filament v5 map picker field built on Leaflet + OpenStreetMap (free services only).


dir="auto")^8.2^11 or ^12^5composer require salemaljebaly/filament-map-picker
Publish config (optional):
php artisan vendor:publish --tag=filament-map-picker-config
This component writes to your latitude/longitude fields. Keep the map field itself non-dehydrated.
use Filament\Forms;
use SalemAljebaly\FilamentMapPicker\MapPicker;
Forms\Components\Hidden::make('latitude')->rules(['nullable', 'numeric']),
Forms\Components\Hidden::make('longitude')->rules(['nullable', 'numeric']),
MapPicker::make('location')
->label('Location')
->latlngFields('latitude', 'longitude')
->searchable()
->collapsibleSearch()
->draggable()
->height(320),
use SalemAljebaly\FilamentMapPicker\MapView;
MapView::make('location')
->label('Location')
->latlngFields('latitude', 'longitude')
->height(240),
Defaults live in config/filament-map-picker.php.
Common options:
default_location.lat, default_location.lngdefault_zoomheightmarker.color, marker.draggableauto_dark_modetile_provider (osm, cartodb_light, cartodb_dark)controls.my_location, controls.fullscreen, controls.resetcontrol_position (topleft, topright, bottomleft, bottomright)search.enabled, search.collapsible, search.throttle_ms, search.min_length, search.limitsearch.nominatim.email (env: NOMINATIM_EMAIL)Icons are Blade views under:
resources/views/icons/*.blade.phpTo override icons in your app, create matching files here:
resources/views/vendor/filament-map-picker/icons/*.blade.phpFor consistent theming, make sure your SVGs use stroke="currentColor" / fill="currentColor" instead of hard-coded colors.
The browser geolocation API requires HTTPS (except localhost). If it fails, it’s usually due to:
Nominatim has usage policies and rate limits. Browser requests can’t reliably set a custom User-Agent header.
If you expect heavy usage, proxy geocoding through your backend. For light usage, configure:
NOMINATIM_EMAIL="you@example.com"