Download the PHP package marshmallow/nova-map-box-field without Composer

On this page you can find all versions of the php package marshmallow/nova-map-box-field. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package nova-map-box-field

alt text

Nova MapBox Field

Latest Version on Packagist Total Downloads

A field for Laravel Nova to create MapBox polygons and store them into your database. Awesome stuff really!

Installation

Install the package via Composer:

The package registers itself through Laravel's package auto-discovery, so the field's assets are served to Nova automatically.

Publish the config file

Add your MapBox token

The field needs a public MapBox access token. Set it in your .env:

Configuration

After publishing, the defaults live in config/nova-map-box-field.php. Every value is used to initialise a new MapBox field and can be overridden per field with the methods documented under Usage.

Key Default Description
mapbox_key env('MAPBOX_PUBLIC_KEY') Your public MapBox access token.
default.height 300 Map height in pixels.
default.zoom 8 Initial zoom level.
default.latitude 52.111221 Latitude the map is centered on.
default.longitude 4.647251 Longitude the map is centered on.
default.style mapbox://styles/mapbox/light-v10 MapBox style URL.
default.container map DOM container identifier for the map.
default.navigation_controls false Show MapBox navigation controls.
default.draw_controls false Show the polygon drawing controls.
default.polygon_preview.color #ff133b Fill color used when previewing polygons.
default.polygon_preview.opacity 0.5 Fill opacity used when previewing polygons.

Usage

Add the field to a Nova resource. By default the field is hidden from the index view.

Customising the map

All map options can be overridden per field. The values default to your config file.

Centering the map dynamically

Use setCenter() to derive the center from the resource. Return an [latitude, longitude] array, or a falsy value to keep the current center.

Adding markers

addMarker() pushes a marker onto the map. Return an [latitude, longitude] array, or a falsy value to add nothing. Call it multiple times to add multiple markers.

A default polygon

Draw a default polygon around a coordinate within a given range in kilometres.

Prefilling polygons

Use prefillWith() to render existing polygons on the map. The callback must return an array of Marshmallow\MapBox\Polygon objects; anything else throws an exception.

Credits

License

The MIT License. Please see the License File for more information.


All versions of nova-map-box-field with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package marshmallow/nova-map-box-field contains the following files

Loading the files please wait ...