承接 musabgaili/filament-openstreetmap-mod 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

musabgaili/filament-openstreetmap-mod

Composer 安装命令:

composer require musabgaili/filament-openstreetmap-mod

包简介

This is my package filament-openstreetmap

README 文档

README

Latest Version on Packagist

Total Downloads

Add openstreetmap field to filament form

Full free map API

Interface

2024-01-19_09-54-03

How it view in database

NVIDIA_Share_Yn8wCeCsJf

Installation

You can install the package via composer:

composer require traineratwot/filament-openstreetmap

Usage

Make model with migration

return new class extends Migration {
    public function up(): void
    {
        Schema::create('map_points', function (Blueprint $table) {
            $table->id();

            $table->point('point')->nullable(); // for Point type in Laravel 10
            $table->geography('point', 'point', 0)->nullable(); // for Point type in Laravel 11

            $table->string('point_string')->nullable(); // for String type
            $table->json('point_array')->nullable(); // for Array type
            $table->timestamps();
        });
    }

    public function down(): void
    {
        Schema::dropIfExists('map_points');
    }
};
namespace App\Models;

use MatanYadaev\EloquentSpatial\Objects\Point;
use Illuminate\Database\Eloquent\Model;

class MapPoint extends Model
{

    protected $casts = [
        'point' => Point::class, // Important for Point type
        'point_array' => 'array', // Important for Array type
    ];
    
    ...
}

Make filament resource

<?php

namespace App\Filament\Resources;

use Traineratwot\FilamentOpenStreetMap\Forms\Components\MapInput;


class MapPointResource extends Resource
{
    protected static ?string $model = MapPoint::class;

    public static function form(Form $form): Form
    {
        return $form
            ->schema([
                MapInput::make('point')
                    ->saveAsPoint() // Important for Point type
                    ->srid(4326) // Change srid for Point
                    ->placeholder('Choose your location')
                    ->coordinates(37.619, 55.7527) // start coordinates
                    ->rows(10) // height of map
                ,

                MapInput::make('point_string')
                    ->saveAsString() // default 
                    ->placeholder('Choose your location')
                    ->coordinates(37.619, 55.7527) // start coordinates
                    ->rows(10) // height of map
                ,

                MapInput::make('point_array')
                    ->saveAsArray() // Important for Array type
                    ->placeholder('Choose your location')
                    ->coordinates(37.619, 55.7527) // start coordinates
                    ->rows(10) // height of map
                ,

              ]);
    }
...
}

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

Used packages

composer: matanyadaev/laravel-eloquent-spatial
npm: ol
npm: ol-geocoder

统计信息

  • 总下载量: 8
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 11
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-08-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固