geocoder-php/google-maps-provider
最新稳定版本:4.8.0
Composer 安装命令:
composer require geocoder-php/google-maps-provider
包简介
Geocoder GoogleMaps adapter
README 文档
README
This is the Google Maps provider from the PHP Geocoder. This is a READ ONLY repository. See the main repo for information and documentation.
Usage
$httpClient = new \Http\Discovery\Psr18Client(); // You must provide an API key $provider = new \Geocoder\Provider\GoogleMaps\GoogleMaps($httpClient, null, 'your-api-key'); $result = $geocoder->geocodeQuery(GeocodeQuery::create('Buckingham Palace, London'));
All requests require a valid API key, however google does have a free tier available. Please see this page for information on getting an API key.
Google Maps for Business
Previously, google offered a "Business" version of their APIs. The service has been deprecated, however existing clients
can use the static business method on the provider to create a client:
$httpClient = new \Http\Discovery\Psr18Client(); // Client ID is required. Private key is optional. $provider = \Geocoder\Provider\GoogleMaps\GoogleMaps::business($httpClient, 'your-client-id', 'your-private-key'); $result = $geocoder->geocodeQuery(GeocodeQuery::create('Buckingham Palace, London'));
Install
composer require geocoder-php/google-maps-provider
Contribute
Contributions are very welcome! Send a pull request to the main repository or report any issues you find on the issue tracker.
统计信息
- 总下载量: 16.82M
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 193
- 点击次数: 1
- 依赖项目数: 44
- 推荐数: 4
其他信息
- 授权协议: MIT
- 更新时间: 2026-01-04