定制 goldfinch/google-autocomplete 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

goldfinch/google-autocomplete

最新稳定版本:v1.0.7

Composer 安装命令:

composer require goldfinch/google-autocomplete

包简介

Google Map field, Google Place Autocomplete field for Silverstripe to retrieve Latitude, Longitude, Zoom, Address details such as Street name, Region, Country and more

README 文档

README

Silverstripe Version Package Version Total Downloads License

Google Map and Google Place (Autocomplete) fields for Silverstripe

Install

composer require goldfinch/google-fields

.env

APP_GOOGLE_MAPS_KEY=""

Usage

Map component

Library required Maps JavaScript API

Screenshot

use Goldfinch\GoogleFields\Forms\MapField;

private static $db = [
    'Map' => 'Map',
];

// ..

MapField::create('Map')

//

MapField::create('Map', 'Map')
    ->setSettings([
        'lng' => 168.7439017,
        'lat' => -45.0136784,
        'zoom' => 10,
    ])
    ->mapHideSearch()
    ->mapHideExtra()
    ->mapReadonly()
<!-- template.ss -->

$Map
$Map.Link

$Map.Longitude
$Map.Latitude
$Map.Zoom

Place autocomplete component

Library required Places API

Screenshot

use Goldfinch\GoogleFields\Forms\PlaceField;

private static $db = [
    'Place' => 'Place',
];

// ...

PlaceField::create('Place')

//

PlaceField::create('Place', 'Place')
    ->setSettings([
      'country' => 'ru',
    ])
    ->placeHidePreview()
<!-- template.ss -->

$Place.Address
$Place.Data

$Place.Link

$Place.Subpremise
$Place.StreetNumber
$Place.StreetName
$Place.Suburb
$Place.Subarea
$Place.Region
$Place.District
$Place.Country
$Place.Postcode

$Place.PlaceName
$Place.Latitude
$Place.Longitude

License

The MIT License (MIT)

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-12-19