superdry / geolocation
Geolocation class that connects to Google Maps API
Installs: 1 508
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: >=5.4.16
Requires (Dev)
This package is auto-updated.
Last update: 2024-09-14 03:23:32 UTC
README
Table of Contents
Installation
Install Composer
$ php -r "readfile('https://getcomposer.org/installer');" | php && php composer.phar install
$ composer require superdry/geolocation
Then include Composer's generated vendor/autoload.php to enable autoloading:
Usage
require 'vendor/autoload.php'; use superdry\geolocation\GeolocationService;
example
getCoordinates
Get latitude/longitude coordinates from address.
$street = 'Koningin Maria Hendrikaplein'; $streetNumber = '1'; $city = 'Gent'; $zip = '1'; $country = 'belgium'; $geolocation = new GeolocationService(); $result = $geolocation->getCoordinates( $street, $streetNumber, $city, $zip, $country );
getAddress
Get address from latitude/longitude coordinates.
$latitude = 51.0363935; $longitude = 3.7121008; $geolocation = new GeolocationService(); $result = $geolocation->getAddress( $latitude, $longitude );
Maintainers
License
MIT © SuperdryPlc