2017 © Pedro Peláez
 

library google-geocoder

Abstraction for geocoding through Google Maps.

image

navjobs/google-geocoder

Abstraction for geocoding through Google Maps.

  • Thursday, July 5, 2018
  • by joshforbes
  • Repository
  • 5 Watchers
  • 53 Stars
  • 4,252 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 7 Versions
  • 6 % Grown

The README.md

Circle CI Code Climate, (*1)

Google Geocoding

Provides an abstraction for requests to Google Maps geocoding service., (*2)

Installation

You can install this package via Composer using this command:, (*3)

composer require ConstructionJobs/google-geocoder

Laravel Installation

This package comes with a service provider for use with Laravel. You will not need to do anything if you're using laravel version 5.5 and up., (*4)

If you are using laravel 5.4 or below, to install the service provider:, (*5)

// config/app.php
'providers' => [
    // other providers
    'ConstructionJobs\GoogleGeocoder\GoogleGeocoderServiceProvider'
];

Also you must publish the config file:, (*6)

php artisan vendor:publish --provider="ConstructionJobs\GoogleGeocoder\GoogleGeocoderServiceProvider"

The config file allows you to set your api key, language and region., (*7)

Usage

There are three ways that you may use this package., (*8)

// Geocode an address
$geocoder = new Geocoder;
$geocoder->geocode('New York, NY');

// Reverse geocode from coordinates
$geocoder = new Geocoder;
$geocoder->reverseByCoordinates(40.7127837, -74.0059413);

// Reverse geocode from a Google place id.
$geocoder = new Geocoder;
$geocoder->reverseByPlaceId('ChIJOwg_06VPwokRYv534QaPC8g');

All of these methods return a standard response format as follows:, (*9)

[
    'address' => 'New York, NY, USA',
    'latitude' => 40.7127837,
    'longitude' => -74.0059413,
    'place_id' => ChIJOwg_06VPwokRYv534QaPC8g,
    'types' => [
        'locality',
        'political'
    ]
    $bounds = [
        'northeast' => [
            'latitude' => 40.9152555,
            'longitude' => -73.7002721,
        ],
        'southwest' => [
            'latitude' => 40.496044,
            'longitude' => -74.255735,
        ]
    ];
}

The Versions

05/07 2018

dev-master

9999999-dev https://navjobs.com

Abstraction for geocoding through Google Maps.

  Sources   Download

MIT

The Requires

 

The Development Requires

geocoding google maps

05/07 2018

0.1.4

0.1.4.0 https://navjobs.com

Abstraction for geocoding through Google Maps.

  Sources   Download

MIT

The Requires

 

The Development Requires

geocoding google maps

11/11 2016

dev-develop

dev-develop https://navjobs.com

Abstraction for geocoding through Google Maps.

  Sources   Download

MIT

The Requires

 

The Development Requires

geocoding google maps

11/11 2016

0.1.3

0.1.3.0 https://navjobs.com

Abstraction for geocoding through Google Maps.

  Sources   Download

MIT

The Requires

 

The Development Requires

geocoding google maps

10/11 2016

0.1.2

0.1.2.0 https://navjobs.com

Abstraction for geocoding through Google Maps.

  Sources   Download

MIT

The Requires

 

The Development Requires

geocoding google maps

10/11 2016

0.1.1

0.1.1.0 https://navjobs.com

Abstraction for geocoding through Google Maps.

  Sources   Download

MIT

The Requires

 

The Development Requires

geocoding google maps

10/11 2016

0.1.0

0.1.0.0 https://navjobs.com

Abstraction for geocoding through Google Maps.

  Sources   Download

MIT

The Requires

 

The Development Requires

geocoding google maps