PHPackages                             langleyfoxall/simple-google-maps - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. langleyfoxall/simple-google-maps

ActiveLibrary[API Development](/categories/api)

langleyfoxall/simple-google-maps
================================

Simple PHP client for various Google Maps APIs

v2.0.0(11mo ago)17.7k2[3 issues](https://github.com/langleyfoxall/php-simple-google-maps/issues)[5 PRs](https://github.com/langleyfoxall/php-simple-google-maps/pulls)LGPL-3.0-onlyPHPPHP &gt;=7.0||&gt;=8.0

Since Nov 30Pushed 11mo ago3 watchersCompare

[ Source](https://github.com/langleyfoxall/php-simple-google-maps)[ Packagist](https://packagist.org/packages/langleyfoxall/simple-google-maps)[ RSS](/packages/langleyfoxall-simple-google-maps/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (10)Dependencies (4)Versions (19)Used By (0)

PHP Simple Google Maps
======================

[](#php-simple-google-maps)

[![StyleCI](https://camo.githubusercontent.com/efdc67599ecb70747c6614180d7ce1638a72e191b4c07efb736e542e9333780e/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3135393830393336382f736869656c643f6272616e63683d6d6173746572)](https://github.styleci.io/repos/159809368)[![](https://camo.githubusercontent.com/8d492edbe26cf7713c60012ab75eaf89d65a487311989a313e65ec356f0b4d38/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c616e676c6579666f78616c6c2f73696d706c652d676f6f676c652d6d6170732e737667)](https://packagist.org/packages/langleyfoxall/simple-google-maps/stats)

This package provides a simple PHP client for various Google Maps APIs.

Installation
------------

[](#installation)

To install, just run the following composer command.

```
composer require langleyfoxall/simple-google-maps
```

Remember to include the `vendor/autoload.php` file if your framework does not do this for you.

Usage
-----

[](#usage)

To use Simple Google Maps, you must first create a new instance. This can be done is two ways, dependant on whether you have a standard API `key`, or a `clientName` and `cryptKey` (for enterprise / premium plans).

```
// Standard authentication:
$simpleGoogleMaps = SimpleGoogleMapsFactory::getByKey(getenv('KEY'));

// Enterprise / premium plan authentication:
$simpleGoogleMaps = SimpleGoogleMapsFactory::getByClientNameAndCryptKey(getenv('CLIENT_NAME'), getenv('CRYPT_KEY'));
```

### Geocoding

[](#geocoding)

To convert an address to a set of GPS coordinates, use the `geocode` method, as shown below.

```
$latLng = $simpleGoogleMaps->geocode('10 Downing St, Westminster, London SW1A UK');
```

Optionally, you can allow partial matches to be returned if your input address is not highly accurate. You can do so with the `allowPartialMatches` method, as shown below.

```
$latLng = $simpleGoogleMaps->allowPartialMatches()->geocode('test address');
```

The above method will return a object of type `LatLong`, which allows you to access the GPS coordinates as shown below.

```
$latitude = $latLng->lat;
$longitude = $latLng->long;
```

You can also calculate the distance between two `LatLong` objects by using the `distanceTo` method. The distance is returned in kilometers, and takes into account the curvature of the Earth using the Haversine formula.

```
$distance = $fromCoords->distanceTo($toCoords);
```

### Reverse Geocoding

[](#reverse-geocoding)

To lookup an address from a set of GPS coordinate, use the `reverseGeocode` method, as shown below.

```
$address = $simpleGoogleMaps->reverseGeocode(new LatLong(51.5033635, -0.1276248));
```

This method will return a string containing the address found at the specified coordinates. If no address could be found, `null` will be returned.

### Directions

[](#directions)

To find the directions between two points, use the `directions` method. The methods expects three parameters, the origin, the destination, and optionally the travel mode as defined by the `TravelMode` enum.

See the example usage below.

```
$address1 = "10 Downing St, Westminster, London SW1A UK";
$address2 = "Schott House, Drummond Rd, Stafford ST16 3EL";

$journey = $simpleGoogleMaps->directions($address1, $address2, TravelMode::DRIVING);

foreach($journey as $step) {
    echo $step->duration.' secs  ';
    echo "\t";
    echo $step->distance.' m    ';
    echo "\t";
    echo $step->description;
    echo PHP_EOL;
}

echo 'Totals: '.$journey->duration().' secs, '.$journey->distance().' km';
echo PHP_EOL;
```

This will produce output similar to the following.

```
134 secs        452 m           Head north on Whitehall / A3212 toward Horse Guards Ave May be closed at certain times or days
203 secs        1029 m          At the roundabout, take the 1st exit onto The Mall Parts of this road may be closed at certain times or days
121 secs        688 m           Turn right onto Constitution Hill
34 secs         141 m           Turn left onto Duke of Wellington Pl Leaving toll zone
20 secs         83 m            Turn right onto Grosvenor Pl
21 secs         107 m           Slight right onto Piccadilly May be closed at certain times or days
164 secs        1244 m          Slight left onto Park Ln / A4202
35 secs         199 m           Slight left onto Cumberland Gate
16 secs         68 m            Turn right onto Bayswater Rd
92 secs         410 m           Slight left onto Edgware Rd / A5 Entering toll zone in 280 m at Upper Berkeley St Leaving toll zone in 300 m at Stourcliffe St
48 secs         177 m           Turn right onto George St Entering toll zone
152 secs        531 m           Turn left onto Seymour Pl
46 secs         231 m           Turn left onto Marylebone Rd / A501 Leaving toll zone
722 secs        9209 m          Keep right to continue on Marylebone Flyover / A40 Continue to follow A40
708 secs        14581 m         Keep right to continue on Western Ave / A40
4636 secs       140047 m        Keep right to continue on M40 , follow signs for M25 / Birmingham / Oxford / Beaconsfield
49 secs         1164 m          At junction 3A , take the M42 / Railway Station / Airport exit to M1 / M6 / Birmingham (E, N & C) / Solihull / N.E.C.
856 secs        22091 m         Merge onto M42
14 secs         375 m           Keep right at the fork to continue on M6 Toll
1121 secs       33363 m         Keep right at the fork to stay on M6 Toll Toll road
756 secs        19905 m         Continue onto M6
23 secs         206 m           At junction 14 , take the A34 exit to Stone / Stafford (N)
103 secs        1213 m          At the roundabout, take the 3rd exit onto A34 Go through 1 roundabout
80 secs         925 m           At the roundabout, take the 2nd exit onto Beaconside / A513
128 secs        1550 m          Turn right onto Common Rd
13 secs         123 m           Turn left onto Astonfields Rd
76 secs         395 m           Turn left onto Drummond Rd Destination will be on the left
Totals: 10371 secs, 250507 km

```

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance32

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity74

Established project with proven stability

 Bus Factor1

Top contributor holds 73.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~239 days

Recently: every ~402 days

Total

11

Last Release

336d ago

Major Versions

v0.3.0 → v1.0.02019-11-13

v1.4.0 → v2.0.02025-06-17

PHP version history (2 changes)v0.1.0PHP &gt;=7.0

v1.3.0PHP &gt;=7.0||&gt;=8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/c580cdf7c14898fff179cdfc1085892091d5d2f49d917873a12365af9ac77c93?d=identicon)[Jord-JD](/maintainers/Jord-JD)

![](https://www.gravatar.com/avatar/250ad189b21ef862e3f0727fc0e416deb51588f7681ec35792327b1bd500e9ca?d=identicon)[langleyfoxall](/maintainers/langleyfoxall)

---

Top Contributors

[![Jord-JD](https://avatars.githubusercontent.com/u/650645?v=4)](https://github.com/Jord-JD "Jord-JD (25 commits)")[![jameswilddev](https://avatars.githubusercontent.com/u/3138458?v=4)](https://github.com/jameswilddev "jameswilddev (4 commits)")[![Warren-CB](https://avatars.githubusercontent.com/u/126696209?v=4)](https://github.com/Warren-CB "Warren-CB (2 commits)")[![kirstyg](https://avatars.githubusercontent.com/u/6988205?v=4)](https://github.com/kirstyg "kirstyg (1 commits)")[![kirsty-gasston](https://avatars.githubusercontent.com/u/12949343?v=4)](https://github.com/kirsty-gasston "kirsty-gasston (1 commits)")[![lfnicklangley](https://avatars.githubusercontent.com/u/10709152?v=4)](https://github.com/lfnicklangley "lfnicklangley (1 commits)")

---

Tags

geocodinggoogle-map-apigoogle-mapslatitude-and-longitudephp-libraryreverse-geocoding

### Embed Badge

![Health badge](/badges/langleyfoxall-simple-google-maps/health.svg)

```
[![Health](https://phpackages.com/badges/langleyfoxall-simple-google-maps/health.svg)](https://phpackages.com/packages/langleyfoxall-simple-google-maps)
```

###  Alternatives

[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k7.6M74](/packages/openai-php-laravel)[statamic/cms

The Statamic CMS Core Package

4.8k3.2M720](/packages/statamic-cms)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[nickurt/laravel-postcodeapi

Universal PostcodeApi for Laravel 11.x/12.x/13.x

97221.2k](/packages/nickurt-laravel-postcodeapi)[mozex/anthropic-laravel

Anthropic PHP for Laravel is a supercharged PHP API client that allows you to interact with the Anthropic API

71226.4k1](/packages/mozex-anthropic-laravel)[scriptdevelop/whatsapp-manager

Paquete para manejo de WhatsApp Business API en Laravel

762.6k](/packages/scriptdevelop-whatsapp-manager)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
