PHPackages                             emiliobravo/filament-google-maps-picker - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. emiliobravo/filament-google-maps-picker

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

emiliobravo/filament-google-maps-picker
=======================================

A Filament Field to get coordinates based on Google Maps

333PHP

Since Jun 25Pushed 3y ago1 watchersCompare

[ Source](https://github.com/EmilioBravo/filament-google-maps-picker)[ Packagist](https://packagist.org/packages/emiliobravo/filament-google-maps-picker)[ RSS](/packages/emiliobravo-filament-google-maps-picker/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Filament Google Maps Picker
===========================

[](#filament-google-maps-picker)

[![Latest Version on Packagist](https://camo.githubusercontent.com/89002f21788de68831d38f57976b45badb4aaefc8bb84b6dd5f3f3942e03b842/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f656d696c696f627261766f2f66696c616d656e742d676f6f676c652d6d6170732d7069636b65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/emiliobravo/filament-google-maps-picker)[![GitHub Tests Action Status](https://camo.githubusercontent.com/3c2b1bba128550386c4e1eae2ba86225fc1be36c962a842993e533813b4e6a9e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f656d696c696f627261766f2f66696c616d656e742d676f6f676c652d6d6170732d7069636b65722f72756e2d74657374733f6c6162656c3d7465737473)](https://github.com/emiliobravo/filament-google-maps-picker/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/a97bd894bc763417e9833f5211abbc03e13d20750bfc517770f7fc72ace110ff/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f656d696c696f627261766f2f66696c616d656e742d676f6f676c652d6d6170732d7069636b65722f436865636b253230262532306669782532307374796c696e673f6c6162656c3d636f64652532307374796c65)](https://github.com/emiliobravo/filament-google-maps-picker/actions?query=workflow%3A%22Check+%26+fix+styling%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/7c4ca81132305f1a7419767eac050716f656f6f565499deb6e6c2c1c33268fb1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f656d696c696f627261766f2f66696c616d656e742d676f6f676c652d6d6170732d7069636b65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/emiliobravo/filament-google-maps-picker)

A Filament Field to get coordinates based on Google Maps.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require emiliobravo/filament-google-maps-picker
```

You must define an environment variable `GOOGLE_MAPS_API_KEY` in your .env file with your [Google Maps API Key](https://developers.google.com/maps/documentation/embed/get-api-key#:~:text=Go%20to%20the%20Google%20Maps%20Platform%20%3E%20Credentials%20page.&text=On%20the%20Credentials%20page%2C%20click,Click%20Close.)

You can publish the config file with:

```
php artisan vendor:publish --tag="filament-google-maps-picker-config"
```

This is the contents of the published config file:

```
return [
    'google_maps_key' => env('GOOGLE_MAPS_API_KEY')
];
```

Optionally, you can publish the views using

```
php artisan vendor:publish --tag="filament-google-maps-picker-views"
```

Usage
-----

[](#usage)

### On your filament resource file

[](#on-your-filament-resource-file)

```
use EmilioBravo\FilamentGoogleMapsPicker\Forms\Components\LocationPicker;
```

### On your filament form schema

[](#on-your-filament-form-schema)

```
        LocationPicker::make('location')
```

This will display a simple Google Maps field with a marker in latitude 0 and longitude 0. When you click on the map, the field value and the marker positions uptades to the new coordinates.

[![Example 1](https://github.com/EmilioBravo/filament-google-maps-picker/raw/master/resources/readme/example1.jpg?raw=true)](https://github.com/EmilioBravo/filament-google-maps-picker/blob/master/resources/readme/example1.jpg?raw=true)

Enabling Google Maps controls
-----------------------------

[](#enabling-google-maps-controls)

Use this methods to enable Google Maps controls:

`zoomControl(bool)` (default: false) displays de zoom controls allow the user to change it

`mapTypeControl(bool)` (default: false) displays the map type selection control

`scaleControl(bool)` (default: false) displays the map scale control

`streetViewControl(bool)` (default: false) displays the map StreetView control

`fullScreenControl(bool)` (default: false) displays the full screen control

`rotateControl(bool)` (default: false) displays the rotation control

`searchBoxControl(bool)` (default: false) displays search box control to search for locations. Will update the field value upon selection

`geolocationControl(bool)` (default: false) custom control to get the device geolocation and update the map position with it. It required the user to allow the device permission to access geolocation data

`coordsBoxControl(bool)` (default: false) custom control that shows a text input with current value of the field in the format latitude,longitude

Options
-------

[](#options)

`zoom(int)` (default: 1) takes an integer as value and sets the initial zoom of the map

`minHeight(string)` (default: 50vh) accepts a string to set the map height, must be a valid CSS min-height. Ex: 80vh, 30%, 50px

`mapTypeId(string)` (default: roadmap) accepts a string: roadmap,satellite,hybrid, terrain

`searchBoxPlaceholderText(string)` (default: Search Address) accepts a string to customize de search box placeholder text

`locationButtonText(string)` (default: My location) accepts a string to customize de location button text

`fixMarkerOnCenter(bool)` (default: false) when the user drags the map the marker pans to the center and updates the field value

`default(array)` (default: \['lat' =&gt; 0,'lng' =&gt; 0\]) sets the default value

`defaultToMyLocation(bool)` (default: false) sets the default value to the current location

### On your filament form schema

[](#on-your-filament-form-schema-1)

```
        LocationPicker::make('location')
            ->default(['lat' => 40.7587,'lng' => -73.9786])
            ->zoom(15)
            ->zoomControl()
            ->minHeight('60vh')
            ->mapTypeId('satellite')
            ->mapTypeControl()
            ->scaleControl()
            ->streetViewControl()
            ->fullScreenControl()
            ->rotateControl()
            ->searchBoxControl()
            ->searchBoxPlaceholderText('Type an address')
            ->geolocationControl()
            ->locationButtonText('Go to my location')
            ->defaultToMyLocation()
            ->coordsBoxControl()
            ->fixMarkerOnCenter()
```

This will display a map with all the available options

[![Example 2](https://github.com/EmilioBravo/filament-google-maps-picker/raw/master/resources/readme/example2.jpg?raw=true)](https://github.com/EmilioBravo/filament-google-maps-picker/blob/master/resources/readme/example2.jpg?raw=true)

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Credits
-------

[](#credits)

- [Luis Escobar Bravo](https://github.com/EmilioBravo)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity25

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/e0c7e493217cc34f66d1067257fbdb482a4305fe6b1bb570324980dad969e5b3?d=identicon)[EmilioBravo](/maintainers/EmilioBravo)

---

Top Contributors

[![EmilioBravo](https://avatars.githubusercontent.com/u/544288?v=4)](https://github.com/EmilioBravo "EmilioBravo (2 commits)")

### Embed Badge

![Health badge](/badges/emiliobravo-filament-google-maps-picker/health.svg)

```
[![Health](https://phpackages.com/badges/emiliobravo-filament-google-maps-picker/health.svg)](https://phpackages.com/packages/emiliobravo-filament-google-maps-picker)
```

###  Alternatives

[nojimage/twitter-text-php

A library of PHP classes that provide auto-linking and extraction of usernames, lists, hashtags and URLs from tweets.

1241.9M7](/packages/nojimage-twitter-text-php)[drupol/composer-packages

Composer Packages is a Composer plugin for getting information about installed packages in your project.

32274.0k1](/packages/drupol-composer-packages)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
