This package allows adding fields with Mapbox, to select a location (by long - latitude).
This package is still under development, it is basicually functioning but not guaranted working perfectly or match multiple use cases
This field requires attributes using the package MatanYadaev/laravel-eloquent-spatial
- Nova ^4.x.x
- Laravel 8 (due to the dependencies of
MatanYadaev/laravel-eloquent-spatial:2.x.x
- Composer package install
composer require takashato/nova-map-marker-field
- Put this to your
configs/services.php
<?php
return [
'mapbox' => [
'public_token' => env('MAPBOX_PUBLIC_TOKEN'),
],
];
- Put your public access token of Mapbox to the
.env
file
MAPBOX_PUBLIC_TOKEN=<your_public_token>
The token is obtained from Mapbox Dashboard. Mapbox is free for 50k requests / mo but requires credit card for registration. You should consider for this.
NovaMapMarkerField::make(__('Field label'), 'attribute_name')
->hideFromIndex()
->zoom($zoomValue),
$zoomValue
default zoom value of Mapbox (= 10 if empty)attribute_name
the attribute of current resource / model This attribute must implement anPoint
object by the package MatanYadaev/laravel-eloquent-spatial
- me
- (and may be you xD)
Feel free to made PR or put an issue for this package. I will see for them when having free time xD