gurucomkz/geopicker
Composer 安装命令:
composer require gurucomkz/geopicker
包简介
Geolocation Picker field for SilverStripe
README 文档
README
Provides a GeoLocation (for coordinates) field editable with a map.
Uses Google Places API to display the map.
Enable Places API & Maps JavaScript API
Maps JavaScript API is used to display the map.
Places API is used to let you find things there by typing an address.
Check out the following links to get it working
- https://developers.google.com/maps/gmp-get-started#enable-api-sdk
- https://developers.google.com/maps/documentation/places/web-service/get-api-key
Then put the key into your .env file:
PLACES_API_KEY="the-key"
Usage
class Foo extends DataObject { private static $db = [ 'Location' => 'GeoLocation', ]; } # OR class Foo extends DataObject { private static $db = [ 'Location' => DBGeoLocation::class, ]; }
You can then refer to it as
$obj->Location->Latitude; $obj->Location->Longitude;
统计信息
- 总下载量: 29
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2021-10-23