PHPackages                             f104/nova-map-marker-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. f104/nova-map-marker-field

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

f104/nova-map-marker-field
==========================

A Laravel Nova field.

0.5.0(3y ago)04.4kMITVue

Since Jun 22Pushed 3y agoCompare

[ Source](https://github.com/f104/nova-map-marker-field)[ Packagist](https://packagist.org/packages/f104/nova-map-marker-field)[ GitHub Sponsors](https://github.com/mikebronner)[ RSS](/packages/f104-nova-map-marker-field/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (1)Dependencies (3)Versions (31)Used By (0)

Map Marker Field for Laravel Nova
=================================

[](#map-marker-field-for-laravel-nova)

[![GitHub (pre-)release](https://camo.githubusercontent.com/a076a3609ad835dc094d2588cab98c6b595c5911f9b9f981945bcce2f89810c5/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f47656e65614c6162732f6e6f76612d6d61702d6d61726b65722d6669656c642f616c6c2e737667)](https://github.com/GeneaLabs/nova-map-marker-field)[![Packagist](https://camo.githubusercontent.com/4ddcdf8ea8d4b7aba71f2af6908067d588e25433e5acac9d14f377d7bb1c1ec7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f47656e65614c6162732f6e6f76612d6d61702d6d61726b65722d6669656c642e737667)](https://packagist.org/packages/genealabs/nova-map-marker-field)[![GitHub license](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](https://raw.githubusercontent.com/GeneaLabs/nova-map-marker-field/master/LICENSE)

[![Map Marker Field for Laravel Nova masthead image.](https://repository-images.githubusercontent.com/193125151/642cd600-9590-11e9-99d0-d77a638bf308)](https://repository-images.githubusercontent.com/193125151/642cd600-9590-11e9-99d0-d77a638bf308)

Supporting This Package
-----------------------

[](#supporting-this-package)

This is an MIT-licensed open source project with its ongoing development made possible by the support of the community. If you'd like to support this, and our other packages, please consider [becoming a sponsor](https://github.com/sponsors/mikebronner).

We thank the following sponsors for their generosity, please take a moment to check them out:

- [LIX](https://lix-it.com)

Requirements
------------

[](#requirements)

- Laravel 8.0+
- Nova 3.9+

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

[](#installation)

1. Install the package:

```
composer require genealabs/nova-map-marker-field
```

2. Publish the marker icon assets (this is not necessary if you are specifying your own):

```
php artisan vendor:publish --provider="GeneaLabs\NovaMapMarkerField\Providers\Service"
```

Implementation
--------------

[](#implementation)

To create the map marker field, all that is necessary is the form label, and the remaining options will have defaults applied:

```
use GeneaLabs\NovaMapMarkerField\MapMarker;

MapMarker::make("Location"),
```

### Coordinate Field Names

[](#coordinate-field-names)

By default the field will look for `latitude` and `longitude` fields on the model. However, if your model uses different names, you may customize them with the `->latitude('lat')` and `->longitude('long')` methods:

```
MapMarker::make("Location")
    ->latitude('lat')
    ->longitude('long'),
```

### Default Settings

[](#default-settings)

You can specify default settings for zoom level, and initial map center coordinates. If not specified, the zoom level will default to 12; the coordinates will default to (0, 0).

```
MapMarker::make("Location")
    ->defaultZoom(8)
    ->defaultLatitude(41.823611)
    ->defaultLongitude(-71.422222),
```

### Center Circle

[](#center-circle)

The optional `centerCircle()` method allows the addition of a circle to be rendered at the centerpoint of the map.

```
MapMarker::make("Location")
    ->centerCircle($radiusInMeters, $color, $borderWidth, $backgroundOpacity),
```

### Search Provider

[](#search-provider)

The underlying search capabilities are provided by [leaflet-geosearch](https://github.com/smeijer/leaflet-geosearch). Please refer to their documentation for provider configuration. By default we use the ESRI search provider.

```
MapMarker::make("Location")
    ->searchProvider('google')
    ->searchProviderKey('xxxxxxxxxxxxxxxxxxxxxxxxxxx'),
```

You can specify a custom search label in the geosearch box:

```
MapMarker::make('Location')
    ->searchLabel('Enter Address');
```

### Tile Layer

[](#tile-layer)

You are free to use any tile provider that is compatible with [Leaflet](https://leafletjs.com/reference-1.5.0.html#tilelayer). Please refer to their documentation on tile layer URLs. By default we use tiles provided by OpenStreetMap:

```
MapMarker::make("Location")
    ->tileProvider('http://{s}.somedomain.com/{foo}/{z}/{x}/{y}.png'),
```

### Recenter On Nova Custom Component Events

[](#recenter-on-nova-custom-component-events)

- From your custom component you can trigger the recentering of the map as follows: ```
    Nova.$emit("recenterMapOn", {latitude, longitude});
    ```
- You can define a custom event name that the MapMarker field will respond to: ```
    MapMarker::make('Location')
        ->listenToEventName('customCenterEventTriggerName');
    ```

    You can then trigger the event from your custom component like so: ```
    Nova.$emit("customCenterEventTriggerName", {latitude, longitude});
    ```

Usage
-----

[](#usage)

When creating or editing you can search for an address or city to get the map to the general area you wish to get coordinates for. Then you can precisely position the marker by dragging the map -- the marker will always stay positioned in the middle, while you move the map under it.

When viewing the map in on the detail page, the map and marker are not interactive, and there is no search functionality. However, the user is free to zoom in and out.

Screenshots
-----------

[](#screenshots)

### Create / Edit Field

[](#create--edit-field)

[![Screen Shot 2019-06-23 at 8 16 52 AM](https://user-images.githubusercontent.com/1791050/59978398-b241d980-9590-11e9-9adc-23e5bd9688e0.png)](https://user-images.githubusercontent.com/1791050/59978398-b241d980-9590-11e9-9adc-23e5bd9688e0.png)

### Detail Field

[](#detail-field)

[![Screen Shot 2019-06-23 at 8 17 43 AM](https://user-images.githubusercontent.com/1791050/59978392-a5bd8100-9590-11e9-9ab7-576e7a935dff.png)](https://user-images.githubusercontent.com/1791050/59978392-a5bd8100-9590-11e9-9ab7-576e7a935dff.png)

### Index Field

[](#index-field)

[![Screen Shot 2019-06-23 at 8 32 01 AM](https://user-images.githubusercontent.com/1791050/59978478-778c7100-9591-11e9-9610-3c9a59ca12c4.png)](https://user-images.githubusercontent.com/1791050/59978478-778c7100-9591-11e9-9610-3c9a59ca12c4.png)

Commitment to Quality
---------------------

[](#commitment-to-quality)

During package development I try as best as possible to embrace good design and development practices, to help ensure that this package is as good as it can be. My checklist for package development includes:

- ✅ Achieve as close to 100% code coverage as possible using unit tests.
- ✅ Eliminate any issues identified by SensioLabs Insight and Scrutinizer.
- ✅ Be fully PSR1, PSR2, and PSR4 compliant.
- ✅ Include comprehensive documentation in README.md.
- ✅ Provide an up-to-date CHANGELOG.md which adheres to the format outlined at .
- ✅ Have no PHPMD or PHPCS warnings throughout all code.

Contributing
------------

[](#contributing)

Please observe and respect all aspects of the included Code of Conduct [https://github.com/GeneaLabs/nova-map-marker-field/blob/master/CODE\_OF\_CONDUCT.md](https://github.com/GeneaLabs/nova-map-marker-field/blob/master/CODE_OF_CONDUCT.md).

### Reporting Issues

[](#reporting-issues)

When reporting issues, please fill out the included template as completely as possible. Incomplete issues may be ignored or closed if there is not enough information included to be actionable.

### Submitting Pull Requests

[](#submitting-pull-requests)

Please review the Contribution Guidelines . Only PRs that meet all criterium will be accepted.

If you ❤️ open-source software, give the repos you use a ⭐️.
------------------------------------------------------------

[](#if-you-️-open-source-software-give-the-repos-you-use-a-️)

We have included the awesome `symfony/thanks` composer package as a dev dependency. Let your OS package maintainers know you appreciate them by starring the packages you use. Simply run `composer thanks` after installing this package. (And not to worry, since it's a dev-dependency it won't be installed in your live environment.)

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 81.6% 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 ~42 days

Total

28

Last Release

1361d ago

### Community

Maintainers

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

---

Top Contributors

[![mikebronner](https://avatars.githubusercontent.com/u/1791050?v=4)](https://github.com/mikebronner "mikebronner (129 commits)")[![tanerkay](https://avatars.githubusercontent.com/u/224194?v=4)](https://github.com/tanerkay "tanerkay (14 commits)")[![checkerschaf](https://avatars.githubusercontent.com/u/7757317?v=4)](https://github.com/checkerschaf "checkerschaf (4 commits)")[![f104](https://avatars.githubusercontent.com/u/1565674?v=4)](https://github.com/f104 "f104 (4 commits)")[![JaZo](https://avatars.githubusercontent.com/u/3475007?v=4)](https://github.com/JaZo "JaZo (2 commits)")[![vbezruchkin](https://avatars.githubusercontent.com/u/2760455?v=4)](https://github.com/vbezruchkin "vbezruchkin (1 commits)")[![Energon7](https://avatars.githubusercontent.com/u/28485483?v=4)](https://github.com/Energon7 "Energon7 (1 commits)")[![nicko170](https://avatars.githubusercontent.com/u/9477420?v=4)](https://github.com/nicko170 "nicko170 (1 commits)")[![Orclyx](https://avatars.githubusercontent.com/u/1742238?v=4)](https://github.com/Orclyx "Orclyx (1 commits)")[![angelformica](https://avatars.githubusercontent.com/u/13004762?v=4)](https://github.com/angelformica "angelformica (1 commits)")

---

Tags

laravelnova

### Embed Badge

![Health badge](/badges/f104-nova-map-marker-field/health.svg)

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

###  Alternatives

[spatie/nova-backup-tool

A Laravel Nova tool to backup your application.

361560.7k1](/packages/spatie-nova-backup-tool)[genealabs/laravel-overridable-model

Provide a uniform method of allowing models to be overridden in Laravel.

92398.0k2](/packages/genealabs-laravel-overridable-model)[datomatic/nova-enum-field

A Laravel Nova PHP 8.1 enum field with filters

20134.2k](/packages/datomatic-nova-enum-field)[advoor/nova-editor-js

A Laravel Nova field bringing EditorJs magic to Nova.

92179.0k3](/packages/advoor-nova-editor-js)[simplesquid/nova-enum-field

A Laravel Nova field to add enums to resources.

52391.9k2](/packages/simplesquid-nova-enum-field)[genealabs/laravel-changelog

A Laravel Nova tool.

55250.7k](/packages/genealabs-laravel-changelog)

PHPackages © 2026

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