pderas/laravel-geocoder
最新稳定版本:v2.0.0
Composer 安装命令:
composer require pderas/laravel-geocoder
包简介
A laravel package to help interact with the google maps api.
关键字:
README 文档
README
About
A laravel package to help interact with the google maps api.
Installation
composer require pderas/laravel-geocoder
Publish the config, and fill in the appropriate fields in your .env file
php artisan vendor:publish --provider="Pderas\LaravelGeocoder\LaravelGeocoderServiceProvider"
Usage
Create a new Instance. Base configuration options can be set here, which can be used to override or instead of the values set in the config file. All options here are optional.
$geocoder = new LaravelGeocoder();
$options = [
'countryCode' => null,
'googleMapsApiKey' => env('GOOGLE_MAPS_API),
'googleMapsUrl' => 'https://maps.googleapis.com/maps/api/geocode/json',
'lookupMode' => 'lat-lng'
];
$geocoder = new LaravelGeocoder($options);
To Retrieve information about an address, pass it as parameters to the send function.
// All fields are optional, but the more details provided, the more accurate the results.
$location_data = [
'address_line_1' => null,
'address_line_2' => null,
'city' => null,
'country' => null,
'postal_code' => null,
'province' => null,
'state' => null,
'zip_code' => null,
];
$results = $geocoder->send($location_data)
统计信息
- 总下载量: 807
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-04-15