trinityrank/google-map-with-autocomplete 问题修复 & 功能扩展

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

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

trinityrank/google-map-with-autocomplete

最新稳定版本:v1.0.0

Composer 安装命令:

composer require trinityrank/google-map-with-autocomplete

包简介

Nova Google Map With Autocomplete Field Package.

README 文档

README

This field allows you to work with Google Places API to autocomplete and Google Map on user input and get the full real address with all the metadata (like latitude and longitude).

Installation

You can install the package in to a Laravel app that uses Nova via composer:

composer require trinityrank/google-map-with-autocomplete

Now publish config and localization files:

php artisan vendor:publish --provider="Trinityrank\GoogleMapWithAutocomplete\FieldServiceProvider"

Create an app and enable Places API and create credentials to get your API key https://console.developers.google.com

Add the below to your .env file

GMAPS_API_KEY=############################

Usage

Add the use declaration to your resource and use the fields:

use Trinityrank\GoogleMapWithAutocomplete\TRMap;
use Trinityrank\GoogleMapWithAutocomplete\TRCountry;
use Trinityrank\GoogleMapWithAutocomplete\TRState;
use Trinityrank\GoogleMapWithAutocomplete\TRCity;
use Trinityrank\GoogleMapWithAutocomplete\TRZipCode;
use Trinityrank\GoogleMapWithAutocomplete\TRAddress;

TRMap::make('Map'), // Google Map with address picker
TRCountry::make('Country'), // Country field
TRState::make('State'), // State field
TRCity::make('City'), // City field
TRZipCode::make('Zip Code'), // Zip Code Filed
TRAddress::make('Address'), // Autocomplete address field

Add the use declaration to your resource and use the panel with all fileds:

use Trinityrank\GoogleMapWithAutocomplete\TRLocation;

TRLocation::make('Location'), // All fileds in panel with required rule

Image of character counter

Customize Fields

Add custom latitude, longitude and zoom values for starting point

TRMap::make('Map')
    ->latitude('latitude')
    ->longitude('longitude')
    ->zoom('zoom'),

Hide latitude and longitude field

TRMap::make('Map')
    ->hideLatitude()
    ->hideLongitude(),

You can add any nova basic methods to fileds (Showing / Hiding, Validation ... ).

统计信息

  • 总下载量: 26.15k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 1
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 1
  • Forks: 10
  • 开发语言: Vue

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-05-26