2017 © Pedro Peláez
 

project geocoder

A simple wrapper about Google's geocoding and direction services

image

teamzac/geocoder

A simple wrapper about Google's geocoding and direction services

  • Monday, April 9, 2018
  • by teamzac
  • Repository
  • 1 Watchers
  • 0 Stars
  • 41 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 7 Versions
  • 0 % Grown

The README.md

A lightweight wrapper around the Google Maps geocoding service

Latest Version on Packagist, (*1)

Installation

You can install the package via composer:, (*2)

composer require teamzac/geocoder

Usage

This package uses Laravel's autodiscovery feature, so you do not have to manually add the service provider., (*3)

You can publish the config file if you'd like, or simply add the following to your .env file:, (*4)

GOOGLE_MAPS_API_KEY={{YOUR API KEY HERE}}

The TeamZac\Geocoder\Geocoder class can be resolved from the container, or you can use the facade. There are two primary methods on this class:, (*5)

// get lat/lng from an address
Geocoder::geocode('1600 Pennsvylvania Ave, Washington DC 20500');

// get an address from lat/lng pair
Geocoder::reverseGeocode(38.8976633, -77.036573);

Both methods will return an instance of TeamZac\Geocoder\GeocodeResult, or throw an exception if no results were found., (*6)

The GeocodeResult class is a simple data transfer object that makes it more convenience to access information about the response., (*7)

$result = Geocoder::geocode('123 main street anywhere USA');

$result->getState();
$result->getLocality();
$result->getStreetNumber();

For a full list of available methods, just check out the class' implementation., (*8)

Testing

bash composer test, (*9)

You'll want to copy the .env.example file as .env.testing.php and add your Google Maps API key to enable testing., (*10)

Changelog

Please see CHANGELOG for more information what has changed recently., (*11)

Contributing

Please see CONTRIBUTING for details., (*12)

Security

If you discover any security related issues, please email chad@zactax.com instead of using the issue tracker., (*13)

Credits

The Versions

09/04 2018

dev-master

9999999-dev

A simple wrapper about Google's geocoding and direction services

  Sources   Download

MIT

The Requires

 

The Development Requires

09/04 2018

3.0.0

3.0.0.0

A simple wrapper about Google's geocoding and direction services

  Sources   Download

MIT

The Requires

 

The Development Requires

24/05 2017

v2.0.0

2.0.0.0

A simple wrapper about Google's geocoding and direction services

  Sources   Download

MIT

The Requires

 

The Development Requires

24/05 2017

v1.0.3

1.0.3.0

A simple wrapper about Google's geocoding and direction services

  Sources   Download

MIT

The Requires

 

The Development Requires

07/09 2016

v1.0.2

1.0.2.0

A simple wrapper about Google's geocoding and direction services

  Sources   Download

MIT

The Requires

 

The Development Requires

30/08 2016

v1.0.1

1.0.1.0

A simple wrapper about Google's geocoding and direction services

  Sources   Download

MIT

The Requires

 

The Development Requires

30/08 2016

v1.0.0

1.0.0.0

A simple wrapper about Google's geocoding and direction services

  Sources   Download

MIT

The Requires

 

The Development Requires