evoluty / google-maps-client
PHP Google Maps APIs 客户端
0.2
2019-03-02 22:04 UTC
Requires
- php: >=7.2
- ext-json: *
- myclabs/php-enum: ^1.6
- php-http/discovery: ^1.6
- psr/http-client: ^1.0
- psr/http-factory: ^1.0
Requires (Dev)
Suggests
- guzzlehttp/guzzle: ^6.3
- php-http/guzzle6-adapter: ^2.0
- zendframework/zend-diactoros: ^2.1
This package is auto-updated.
Last update: 2024-09-15 02:57:48 UTC
README
PHP Google Maps APIs 客户端
这个库帮助构建查询并调用 Google Maps APIs
这将解析结果,并以可用和类型化的对象作为结果
安装
运行 composer require evoluty/google-maps-client
或直接在 Packagist 网站 检查
使用方法
使用如下(以下为 TimeZone API 的示例)
$googleClient = new GoogleMapClient('<your_api_key>'); $request = GoogleMapRequest::newTimeZoneRequest( new TimeZoneLocation('39.6034810', '-119.6822510') )->withLanguage(Language::CZECH()); $timeZoneResponse = $googleClient->sendTimeZoneRequest($request);
响应类型取决于您调用的 API,并将包含与 Google API 响应匹配的公共类型化getter
APIs
目前实现了以下 API
- TimeZone API
- Directions API