wm / map-point
一个Laravel Nova字段。
v0.0.10
2024-08-20 13:22 UTC
Requires
- php: ^7.3|^8.0
This package is auto-updated.
Last update: 2024-09-20 14:21:19 UTC
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
用法
地图点
您可以在地图上显示和编辑一个地理信息点(点,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
类而不是数组来表示您的标签页。