filament-locationpickr-field

On this page

Usage

Form field

The form field can be used with no options, by simply adding this to your Filament Form schema:

1use LaraZeus\FilamentLocationPickrField\Forms\Components\LocationPickr;
2...
3 
4 ->schema([
5 ...
6 LocationPickr::make('location'),
7 ....
8 ]);
9...

The name used in the make() function must be the one you set up as your model's column/computed location property.

Full options

The full set of options is as follows. All option methods support closures, as well as direct values.

1use LaraZeus\FilamentLocationPickrField\Forms\Components\LocationPickr;
2...
3 
4 ->schema([
5 ...
6 LocationPickr::make('location')
7 ->mapControls([
8 'mapTypeControl' => true,
9 'scaleControl' => true,
10 'streetViewControl' => true,
11 'rotateControl' => true,
12 'fullscreenControl' => true,
13 'zoomControl' => false,
14 ])
15 ->defaultZoom(5)
16 ->draggable()
17 ->clickable()
18 ->height('40vh')
19 ->defaultLocation([41.32836109345274, 19.818383186960773])
20 ->myLocationButtonLabel('My location'),
21 ....
22 ]);
23...

Infolist entry

The infolist entry can be used with no options, by simply adding this to your Filament Infolist schema:

1use LaraZeus\FilamentLocationPickrField\Infolists\Components\LocationPickr;
2...
3 
4 ->schema([
5 ...
6 LocationPickr::make('location'),
7 ....
8 ]);
9...

The name used in the make() function must be the one you set up as your model's column/computed location property. The components accepts options like defaultZoom, defaultLocation and height.

Our Sponsors

Zeus is an open-source project. Thanks to our sponsors for helping maintain these packages.