定制 pderas/laravel-geocoder 二次开发

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

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

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-04-15