evoluty/google-maps-client

PHP Google Maps APIs 客户端

0.2 2019-03-02 22:04 UTC

This package is auto-updated.

Last update: 2024-09-15 02:57:48 UTC


README

PHP Google Maps APIs 客户端

这个库帮助构建查询并调用 Google Maps APIs
这将解析结果,并以可用和类型化的对象作为结果

Build Status Quality Gate Status codecov Packagist

安装

运行 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