evoluty/google-maps-client

A PHP Google Maps APIs client

0.2 2019-03-02 22:04 UTC

This package is auto-updated.

Last update: 2024-11-15 03:24:54 UTC


README

A PHP client for Google Maps APIs

This library helps building query and call the Google Maps APIs
This will parse results and give usable and typed objects as a result

Build Status Quality Gate Status codecov Packagist

Installation

Run composer require evoluty/google-maps-client or check directly on the packagist website

Usage

Use like the following (example with the TimeZone API)

$googleClient = new GoogleMapClient('<your_api_key>');

$request = GoogleMapRequest::newTimeZoneRequest(
    new TimeZoneLocation('39.6034810', '-119.6822510')
)->withLanguage(Language::CZECH());

$timeZoneResponse = $googleClient->sendTimeZoneRequest($request);

The response type depends on the API that you are calling and will contain public typed getters that match the Google API response

APIs

At the moment the following API are implemented:

  • TimeZone API
  • Directions API