erkurn/filament-address-picker 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

erkurn/filament-address-picker

最新稳定版本:v1.1.3

Composer 安装命令:

composer require erkurn/filament-address-picker

包简介

Pick Or Auto Complete Address For Filament Field

README 文档

README

Pick Address For Filament Field

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

A Filament Field to enable pick location in google map and return geo coordinates. For initial location you can use coordinate or address.

this packages require Google Map API and using this service :

  • Maps JavaScript API
  • Places API

Installation

You can install the package via composer:

composer require erkurn/filament-address-picker

Usage

<?php

class FilamentResource extends Resource
{
    public static function form(Form $form)
    {
        return $form->schema([
            AddressPicker::make('coordinate')
                ->setDefaultLocation([ // Set Default Location
                    'lat' =>    -6.914744,
                    'lng'  =>  107.609810
                ])
                ->mapControls([ // Map Controls
                    'mapTypeControl' => true,
                    'scaleControl' => true,
                    'streetViewControl' => false,
                    'rotateControl' => true,
                    'fullscreenControl' => true,
                    'searchBoxControl' => true
                ])
                ->minHeight(300) // Min Height In Pixels
                ->defaultZoom(16) // Default Zoom
                ->placeholder("Search Address") // Default Search
                ->afterStateUpdated(function ($state, $component, $set) {
                    $location = $component->getAddress(); // Get Details Location After Pick Location
                    
                    $location->getAdminLevels()->get(4)->getName(); // Post Code
                    $location->getStreetName(); // Street Name
                    $location->getStreetNumber(); // Street Number
                })
                ->placeholder("Search Address")
        ]);  
    }
}

Testing

composer test

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.

统计信息

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

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-07-20

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固