PHPackages                             wm/map-multi-linestring-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. wm/map-multi-linestring-nova3

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

wm/map-multi-linestring-nova3
=============================

A Laravel Nova field.

v0.0.10(1y ago)072MITVuePHP &gt;=7.1.0

Since Apr 3Pushed 1y ago2 watchersCompare

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

READMEChangelogDependenciesVersions (5)Used By (0)

map-multi-linestring
====================

[](#map-multi-linestring)

[![Map Multi Linestring, awesome resource field for Nova](banner.jpg)](banner.jpg)

---

[![Version](https://camo.githubusercontent.com/36d99fcb929aa6beeb9827eff7eb4f9f883fce7ff40be505eb56c23791f488e9/687474703a2f2f706f7365722e707567782e6f72672f776d2f6d61702d6d756c74692d6c696e65737472696e672f76657273696f6e)](https://packagist.org/packages/wm/map-multi-linestring)

- [map-multi-linestring](#map-multi-linestring)
    - [Requirements](#requirements)
    - [Installation](#installation)
    - [Develop](#develop)
    - [Usage](#usage)
        - [Map Multi Linestring](#map-multi-linestring-1)
    - [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-multi-linestring
```

Develop
-------

[](#develop)

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

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

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

```
    "wm/map-multi-linestring": "*",
```

in the first time

launch inside the repository hosting the field

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

we need modify composer.lock launch

```
    composer update wm/map-multi-linestring
```

launch inside field

```
    npm install
```

Usage
-----

[](#usage)

### Map Multi Linestring

[](#map-multi-linestring-1)

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

You can display a post gist geography(MultiLineString,4326) area on the map and change it by uploading a new MultiLineString file (.GPX, .KML, .GEOJSON). To use the Map Multi Linestring feature, include the MapMultiLinestring class and add it to your resource's fields. Customize the map settings by providing metadata such as the initial map center, tile server URL, attribution text, minimum and maximum zoom levels, default zoom level, GraphHopper API URL used to specify the URL of the GraphHopper API, and GraphHopper routing profile used by GraphHopper when calculating the route. Routing profiles determine the type of transportation mode and the set of rules that the routing engine will use. The default value for this field is 'foot', which means the routing will be optimized for walking. Other available profiles include 'bike' and 'hike'.

```
    use Wm\MapMultiLinestring\MapMultiLinestring;
    /**
     * 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(),
                ...
            MapMultiLinestring::make('geometry')->withMeta([
                'center' => [42, 10],
                'attribution' => 'Webmapp contributors',
                'tiles' => 'https://api.webmapp.it/tiles/{z}/{x}/{y}.png',
                'minZoom' => 5,
                'maxZoom' => 17,
                'defaultZoom' => 10,
                'graphhopper_api' => 'https://graphhopper.webmapp.it/route',
                'graphhopper_profile' => 'hike'
            ]),
        ];
    }
```

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
