Maps by Rafał Strachowski
CommunityAdds a location picker with address search, GeoJSON shape drawing, a table column and infolist entries that keep working in tabs, modals, repeaters and SPA mode, using OpenStreetMap without an API key.
Author:
Rafał Strachowski
Package health
Automated checks of this plugin's Composer package
15 checks
- Failed: GitHub Actions pinned to SHA — View details on Plumb
- Skipped: GitLab CI includes pinned to SHA
- Passed: Open security advisories
- Passed: Dependabot PR responsiveness — No open Dependabot PRs.
- Skipped: Renovate MR responsiveness
- Failed: Dependabot or Renovate configured — No dependency updater configuration found. View details on Plumb
- Skipped: Dependency update cooldown configured
- Failed: Provides a security policy — View details on Plumb
- Passed: Abandoned or archived — No consulted source marks the package abandoned (packagist, github).
- Passed: Commit and release recency — Active: last commit 0 days ago; last release 0 days ago.
-
Passed:
composer.lock not committed by library
—
composer.lockis absent from the released dist archive. - Passed: Dist archive is lean
-
Passed:
Current Laravel version supported
— Package dependencies resolve together with current Laravel
13.0. -
Passed:
Current PHP version supported
— Constraint
^8.2supports current PHP8.6. - Skipped: Current Symfony version supported
filament/
namespace. Review the source and install at your own risk. Found
malware or an unresolved security issue the author won't
address?
Report it
.
Documentation
- Requirements
- Installation
- Pick a point
- Search for an address
- Draw shapes
- Tables and view pages
- Geocoding
- Tiles
- How it stays reliable
- Testing
- License

Map fields for Filament 4 and 5 that keep working where map plugins usually break: hidden tabs, collapsed sections, repeaters, modals, slide-overs and SPA mode.
MapPicker: click the map, drag the marker or type the coordinates.LocationPicker: the same plus address search, the address of the picked point written to a field, and "use my location".GeoJsonPicker: draw, edit and remove polygons, rectangles, lines and markers, saved as GeoJSON.MapColumn,MapEntry,GeoJsonEntry: map previews in tables and on view pages.
Leaflet with OpenStreetMap. No API key, no build step: the package ships prebuilt assets, and each map component loads only on pages that use it. Free and open source (MIT).

#Requirements
- PHP 8.2+
- Filament 4.16+ or 5.11+
#Installation
composer require certles/filament-maps
php artisan filament:assets
Optionally publish the config file:
php artisan vendor:publish --tag=filament-maps-config
#Pick a point
#One JSON column
// migration
$table->json('location')->nullable();
// model
protected function casts(): array
{
return ['location' => 'array'];
}
// form
use Certles\FilamentMaps\Forms\Components\MapPicker;
MapPicker::make('location');
The state is ['lat' => 52.2297, 'lng' => 21.0122] or null. An empty field is saved as null, never as 0,0.
#Separate latitude and longitude columns
MapPicker::make('location_picker')
->latitudeField('latitude')
->longitudeField('longitude'),
TextInput::make('latitude')->numeric(),
TextInput::make('longitude')->numeric(),
The picker reads both fields, writes the picked point back to them and is not saved itself. The two fields can also be Hidden.
#Options
MapPicker::make('location')
->defaultCenter(50.0617, 19.9373) // used when there is no point yet
->defaultZoom(12)
->mapHeight(400) // px, or any CSS length: '24rem'
->draggable(false) // marker cannot be dragged
->clickToPlace(false) // clicking the map does not move the marker
->coordinateInputs(false) // hide the latitude/longitude inputs
->tiles('https://{s}.tile.example.com/{z}/{x}/{y}.png', '© Example', 18);
Use ->live() when other fields need to react to the point immediately.
#Search for an address

use Certles\FilamentMaps\Forms\Components\LocationPicker;
LocationPicker::make('location')
->addressField('address'), // optional: fills this field with the address
TextInput::make('address'),
Choosing a search result moves the marker and fills the address. Clicking the map or dragging the marker looks up the address of the new point. All MapPicker options work too.
LocationPicker::make('location')
->searchable(false) // no search box
->locateUser(false); // no "use my location" button (it needs HTTPS)
#Draw shapes

// migration: $table->json('service_area')->nullable();
// model: 'service_area' => 'array' in casts()
use Certles\FilamentMaps\Forms\Components\GeoJsonPicker;
GeoJsonPicker::make('service_area')
->shapes(['polygon', 'rectangle']) // any of: marker, polyline, polygon, rectangle
->maxShapes(1) // with 1, a new shape replaces the old one
->searchable(), // search box to find the area first
The state is a GeoJSON FeatureCollection with coordinates rounded to 7 decimals, or null. Invalid GeoJSON and too many shapes fail validation. Rectangles are saved as polygons.
#Tables and view pages

use Certles\FilamentMaps\Infolists\Components\GeoJsonEntry;
use Certles\FilamentMaps\Infolists\Components\MapEntry;
use Certles\FilamentMaps\Tables\Columns\MapColumn;
MapColumn::make('location')->mapWidth(200)->mapHeight(120),
MapEntry::make('location'),
// from separate columns
MapEntry::make('position')
->state(fn ($record) => ['lat' => $record->latitude, 'lng' => $record->longitude]),
GeoJsonEntry::make('service_area'),
#Geocoding
Address search runs on your server: provider API keys never reach the browser, results are cached and each user is rate limited (30 requests per minute by default). The default provider is Photon with OpenStreetMap data and no key.
The public Photon instance is meant for fair use. For heavier use, self-host Photon and set FILAMENT_MAPS_PHOTON_URL. The public instance labels results in English, German or French. Other app locales get local names (for example "Kraków", "Warszawa").
To use another provider, implement Certles\FilamentMaps\Geocoding\Geocoder and bind it:
use Certles\FilamentMaps\Geocoding\CachedGeocoder;
use Certles\FilamentMaps\Geocoding\Geocoder;
$this->app->singleton(Geocoder::class, fn () => new CachedGeocoder(new MyGeocoder(/* ... */), cache()->store()));
In tests, bind Certles\FilamentMaps\Geocoding\FakeGeocoder with a list of GeocodingResult objects. It never calls the network.
#Tiles
OpenStreetMap's public tiles are fine for an admin panel with a handful of users. Read the tile usage policy and switch to a tile provider (tiles() or the config file) for heavier use.
#How it stays reliable
- A map is created only when its container becomes visible (
IntersectionObserver), so maps in hidden tabs, collapsed sections and modals start with the right size. - Every size change (tab switch, modal animation, sidebar collapse) calls Leaflet's
invalidateSize()and re-centres the map if it was never visible. - The map element is ignored by Livewire morphing and is replaced only when its configuration or record changes.
- Components clean up on destroy, so SPA navigation and removed repeater items do not leak map instances.
- Mouse-wheel zoom turns on only after you click the map, so scrolling the page never gets stuck on it.
- The package never sets
window.L, so it does not clash with other Leaflet code on the page.
#Testing
composer test # Pest; CI runs PHP 8.2–8.5 with Filament 4 and 5
tests/e2e/smoke.mjs and tests/e2e/geo-smoke.mjs run Playwright checks against a sandbox app: tabs, a collapsed section with a repeater, a modal, infolists, SPA navigation, address search, drawing and console errors.
#License
MIT. See LICENSE.md.
Featured Plugins
A selection of plugins curated by the Filament team
Soft Theme
A theme that gives panels a warm, approachable look with rounded shapes, gentle colors, and serif headings.
Filament
Custom Fields
Eliminate custom field migrations forever. Let your users create and manage form fields directly in Filament admin panels with 20+ built-in field types, validation, and zero database changes.
Relaticle
Spotlight Pro
Browse your Filament Panel with ease. Filament Spotlight Pro adds a Spotlight like Command Palette to your Filament Panel.
Dennis Koch