PHPackages                             wm/map-point-nova3 - 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. [Templating &amp; Views](/categories/templating)
4. /
5. wm/map-point-nova3

ActiveLibrary[Templating &amp; Views](/categories/templating)

wm/map-point-nova3
==================

A Laravel Nova field.

v0.0.9(3y ago)069MITVuePHP &gt;=7.1.0

Since Mar 31Pushed 3y ago2 watchersCompare

[ Source](https://github.com/webmappsrl/map-point-nova3)[ Packagist](https://packagist.org/packages/wm/map-point-nova3)[ RSS](/packages/wm-map-point-nova3/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

[![Map Point, awesome resource field for Nova](banner.png)](banner.png)

---

[![Version](https://camo.githubusercontent.com/e06533ba0f21c72f91147482c9e0186f269c37f6717a15c33bd9f94dcb987947/687474703a2f2f706f7365722e707567782e6f72672f776d2f6d61702d706f696e742f76657273696f6e)](https://packagist.org/packages/wm/map-point)

- [Requirements](#requirements)
- [Installation](#installation)
- [Develop](#develop)
- [Usage](#usage)
    - [Map Point](#map-point)
- [Configuration](#configuration)

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

[](#requirements)

- `php: ^8`
- `laravel/nova: ^4`

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

[](#installation)

You can install the package in to a Laravel app that uses [Nova](https://nova.laravel.com) via composer:

```
composer require wm/map-point
```

Develop
-------

[](#develop)

create a`nova-components` folder in the root of the project where you want to develop. Clone map-point inside. add in ` "repositories"` array attribute of `composer.json`

```
        {
            "type": "path",
            "url": "./nova-components/map-point"
        }
```

modify in ` "requires"` object attribute of `composer.json`

```
    "wm/map-point": "*",
```

launch inside the repository hosting the field

```
    cd vendor/laravel/nova && npm install
```

we need modify composer.lock launch

```
    composer update wm/map-point
```

launch inside field

```
    npm install
```

Usage
-----

[](#usage)

### Map Point

[](#map-point)

[![image](field.png)](field.png)

You can display and edit a post gist geography(Point,4326) point on map

```
    use Wm\MapPoint\MapPoint;
    /**
     * Get the fields displayed by the resource.
     *
     * @param  \Laravel\Nova\Http\Requests\NovaRequest  $request
     * @return array
     */
    public function fields(NovaRequest $request)
    {
        return [
            ID::make()->sortable(),
                ...
            MapPoint::make('geometry')->withMeta([
                'center' => [42, 10],
                'attribution' => 'Webmapp contributors',
                'tiles' => 'https://api.webmapp.it/tiles/{z}/{x}/{y}.png',
                'minZoom' => 8,
                'maxZoom' => 17,
                'defaultZoom' => 13
            ]),
        ];
    }
```

Configuration
-------------

[](#configuration)

As of v1.4.0 it's possible to use a `Tab` class instead of an array to represent your tabs.

    Property Type Default Description     center array \[0,0\] The coordinates used to center the view of an empty map.  attribution string '&lt;a href="[https://www.openstreetmap.org/"&gt;OpenStreetMap&lt;/a](https://www.openstreetmap.org/">OpenStreetMapMapbox
