PHPackages                             chiiya/nova-leaflet-field - 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. chiiya/nova-leaflet-field

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

chiiya/nova-leaflet-field
=========================

Leaflet map field for Laravel Nova

1.7.0(4y ago)2951—0%1[2 issues](https://github.com/chiiya/nova-leaflet-field/issues)MITPHPPHP &gt;=7.4

Since Jul 22Pushed 4y ago1 watchersCompare

[ Source](https://github.com/chiiya/nova-leaflet-field)[ Packagist](https://packagist.org/packages/chiiya/nova-leaflet-field)[ Docs](https://github.com/chiiya/nova-leaflet-field)[ RSS](/packages/chiiya-nova-leaflet-field/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (9)Used By (0)

 **Nova Leaflet Field
------------------

[](#nova-leaflet-field)**  [![](https://camo.githubusercontent.com/0e9ac047546796cfdbe1423d1f4d91c8f37d2fbb11614a7900bb7686aaa5401f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230372e342d3838393242462e737667)](https://php.net/)

 🗺️ Leaflet map field with geo-coding search for Laravel Nova

 [![](https://raw.githubusercontent.com/chiiya/nova-leaflet-field/master/.github/images/field.png)](https://raw.githubusercontent.com/chiiya/nova-leaflet-field/master/.github/images/field.png)

Index
-----

[](#index)

```
> Installation .....................................................................
> Usage ............................................................................
```

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

[](#installation)

```
composer require chiiya/nova-leaflet-field
# Publish marker icon assets
php artisan vendor:publish --provider="Chiiya\NovaLeafletField\FieldServiceProvider"
```

Usage
-----

[](#usage)

To use the leaflet field, simply specify a label name:

```
LeafletField::make(__('Geo-Location'))
```

The field will only be displayed on detail and form views. It will attempt to look for `latitude` and `longitude` fields on the associated model to set the initial marker on the map, but you may customize this if your field names are different:

```
LeafletField::make(__('Geo-Location'))
    ->latitudeField('lat')
    ->longitudeField('lng')
```

The default tile and search provider for Leaflet is OpenStreetMaps. You may configure any search provider supported by [leaflet-geosearch](https://smeijer.github.io/leaflet-geosearch):

```
LeafletField::make(__('Geo-Location'))
    ->searchProvider(SearchProvider::GOOGLE)
    ->searchProviderKey('api-key')
    ->searchProviderOptions(['language' => 'de', 'region' => 'de'])
```

For customizing the tiles, provide a tile URL:

```
LeafletField::make(__('Geo-Location'))
    ->tileUrl('https://{s}.tile.osm.org/{z}/{x}/{y}.png')
```

There are a number of options to customize the map behaviour:

```
LeafletField::make(__('Geo-Location'))
    // Make the map marker draggable
    ->draggable()
    // Customize the geo-search search label
    ->searchLabel(__('Enter address'))
    // Default map zoom
    ->zoom(12)
    // Customize default latitude & longitude
    ->defaultCoordinates(0.0, 0.0)
```

### Validation

[](#validation)

When marking the field as `required`, the field will additionally validate that coordinates other than the default ones have been selected. If you wish to disable this behaviour, call the following method:

```
LeafletField::make(__('Geo-Location'))
    ->allowDefaultCoordinates()
```

You may also customize the error message shown when default coordinates were selected:

```
LeafletField::make(__('Geo-Location'))
    ->errorMessage(__('Please select a valid location'))
```

### Address Fields Population

[](#address-fields-population)

When using the Google search provider, you may use the data from the selected location to populate other fields on your model:

```
LeafletField::make(__('Geo-Location'))
    ->searchProvider(SearchProvider::GOOGLE)
    ->searchProviderKey('api-key')
    ->populateAddress()
    ->populatePostalCode('zip')
    ->populateCity()
    ->populateCountry()
```

The field will attempt to look for other inputs on the page with the default (`address`, `postal_code`, `city`, `country`) or custom names, and fill them with the values received from the Google Geocoding API. For the address, you may specify a custom format:

```
LeafletField::make(__('Geo-Location'))
    ->searchProvider(SearchProvider::GOOGLE)
    ->searchProviderKey('api-key')
    ->populateAddress()
    // Defaults to '{street_name} {street_number}'
    ->populatedAddressFormat('{street_number}, {street_name}')
```

This will only work when using the Google search provider.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 88.9% 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.

###  Release Activity

Cadence

Every ~21 days

Recently: every ~37 days

Total

8

Last Release

1605d ago

PHP version history (2 changes)1.0.0PHP ^7.4

1.6.0PHP &gt;=7.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/34a7cd6c6e8c5fd30b6cd28645c3384f343fc90d10b0df8c80c7ad424e3dba2a?d=identicon)[chiiya](/maintainers/chiiya)

---

Top Contributors

[![chiiya](https://avatars.githubusercontent.com/u/15029301?v=4)](https://github.com/chiiya "chiiya (8 commits)")[![HajMo](https://avatars.githubusercontent.com/u/50548630?v=4)](https://github.com/HajMo "HajMo (1 commits)")

---

Tags

geocodingmapleafletnova

### Embed Badge

![Health badge](/badges/chiiya-nova-leaflet-field/health.svg)

```
[![Health](https://phpackages.com/badges/chiiya-nova-leaflet-field/health.svg)](https://phpackages.com/packages/chiiya-nova-leaflet-field)
```

###  Alternatives

[optimistdigital/nova-sortable

This Laravel Nova package allows you to reorder models in a Nova resource's index view using drag &amp; drop.

2872.1M6](/packages/optimistdigital-nova-sortable)[outl1ne/nova-sortable

This Laravel Nova package allows you to reorder models in a Nova resource's index view using drag &amp; drop.

2861.8M9](/packages/outl1ne-nova-sortable)[mostafaznv/nova-map-field

Map Field for Laravel Nova

4693.4k](/packages/mostafaznv-nova-map-field)[smile/module-store-locator

Smile Store Locator

51516.6k4](/packages/smile-module-store-locator)[mediawiki/maps

Adds various mapping features to MediaWiki

84145.0k3](/packages/mediawiki-maps)[sbine/route-viewer

A Laravel Nova tool to view your registered routes.

57215.9k](/packages/sbine-route-viewer)

PHPackages © 2026

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