wm / map-point-nova3
Laravel Nova 字段。
v0.0.9
2023-03-31 12:42 UTC
Requires
- php: >=7.1.0
README
要求
php: ^8
laravel/nova: ^4
安装
您可以通过 composer 将此包安装到使用 Nova 的 Laravel 应用中
composer require wm/map-point
开发
在您想要开发的项目根目录中创建一个 nova-components
文件夹。在 map-point 内部进行克隆。在 composer.json
的 "repositories"
数组属性中添加
{ "type": "path", "url": "./nova-components/map-point" }
修改 composer.json
的 "requires"
对象属性
"wm/map-point": "*",
在包含字段的存储库内部启动
cd vendor/laravel/nova && npm install
我们需要修改 composer.lock 启动
composer update wm/map-point
在字段内部启动
npm install
使用
地图点
您可以在地图上显示和编辑一个地理点(Point,4326)的帖子快照
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' => '<a href="https://webmapp.it/">Webmapp</a> contributors', 'tiles' => 'https://api.webmapp.it/tiles/{z}/{x}/{y}.png', 'minZoom' => 8, 'maxZoom' => 17, 'defaultZoom' => 13 ]), ]; }
配置
从 v1.4.0 版本开始,您可以使用 Tab
类而不是数组来表示您的标签页。