biscolab/geocoder

This package is abandoned and no longer maintained. The author suggests using the biscolab/google-maps-php-sdk package instead.
Maintainers

👁 biscolab

Package info

github.com/biscolab/geocoder

pkg:composer/biscolab/geocoder

Statistics

Installs: 203

Dependents: 0

Suggesters: 0

Stars: 1

Open Issues: 0

v1.0 2017-11-18 14:20 UTC

Requires

  • php: >=5.5.9|7.*

Requires (Dev)

None

Suggests

None

Provides

None

Conflicts

None

Replaces

None

MIT 589e7894a7a614fda5717d9c9475f8a63230fe44

  • Roberto Belotti <boby.belotti.woop@gmail.com>

This package is auto-updated.

Last update: 2022-02-01 13:11:03 UTC


README

Replaced by Google Maps PHP SDK

Geocoder

Simple Google Maps Geocoder PHP library. Get Latitude and Longitude of selected address in few steps!

Installation

You can install the package via composer:

composer require biscolab/geocoder:^1.0

How to use

  1. Chose the address
$address = 'street <YOUR_STREET>, <YOUR_CITY>, <YOUR_COUNTRY>';
  1. Get location
$loc = (new Geocoder($address))->getLocation();
  1. Use data getLocation method returns a GeocoderLocation object. To retrieve latitude (Lat) and longitude (Lng) use the following methods:
/**
 * Return the latitude
 *
 * @return float
 */
$lat = $loc->getLat();

/**
 * Return the longitude
 *
 * @return float
 */
$lng = $loc->getLng();

That's it!