geocoder/geocoder

A class for handling geocoding

v1.4.6 2018-02-09 23:21 UTC

README

A class to handle Google geocoding.

Latest Stable Version Build Status Build Status Code Climate Test Coverage Code Coverage Scrutinizer Code Quality Issue Count License StyleCI Codacy Badge Packagist GitHub license

Server Requirements

  • PHP >= 7.0.0

Usage

  • Get the Google Maps Geocoding API key:
    https://developers.google.com/maps/documentation/geocoding/get-api-key
  • Install this package in your project:
    composer require geocoder/geocoder
  • To geocode an address:
    $result = (new Geocoder('THE_API_KEY'))->geocode('THE_ADDRESS');
  • To get latitude and longitude:
    (new Geocoder('THE_API_KEY'))->getLatLng('THE_ADDRESS')

Demo: https://www.notifyontime.com/geocoder