Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jeroendesloovere/geolocation-bundle
This Geolocation Symony2 Bundle uses the geolocation-php-api class using Google Maps API which finds latitude/longitude from an address or reverse.
https://github.com/jeroendesloovere/geolocation-bundle
geolocation-bundle geolocation-php-api latitude longitude php
Last synced: about 2 months ago
JSON representation
This Geolocation Symony2 Bundle uses the geolocation-php-api class using Google Maps API which finds latitude/longitude from an address or reverse.
- Host: GitHub
- URL: https://github.com/jeroendesloovere/geolocation-bundle
- Owner: jeroendesloovere
- License: mit
- Created: 2015-06-09T08:03:21.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-06-10T12:46:34.000Z (over 9 years ago)
- Last Synced: 2024-10-11T13:12:22.036Z (3 months ago)
- Topics: geolocation-bundle, geolocation-php-api, latitude, longitude, php
- Language: PHP
- Homepage:
- Size: 1.37 MB
- Stars: 5
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Geolocation bundle
This Geolocation Symony2 Bundle uses the geolocation-php-api class using Google Maps API which finds latitude/longitude from an address or reverse.
## Usage
### Installation
``` json
{
"require": {
"jeroendesloovere/geolocation-bundle": "1.0.*"
}
}
```
> Adding this code in your `composer.json` file will get the [latest :package_name Packagist package](https://packagist.org/packages/jeroendesloovere/geolocation-bundle using [Composer](https://getcomposer.org).and in app/AppKernel.php
```php
public function registerBundles()
{
$bundles = array(
// ...,
new JeroenDesloovere\Bundle\GeolocationBundle\JeroenDesloovereGeolocationBundle()
);
}
```### Example
```php
$geolocation = $this->get('jeroendesloovere.geolocation');// define result
$result = $geolocation::getCoordinates('Koningin Maria Hendrikaplein', '1', 'Gent', '9000', 'belgië');// dump result
echo 'Coordinates = ' . $result['latitude'] . ', ' . $result['longitude'] . '
';// define result: @return array(label, street, streetNumber, city, cityLocal, zip, country, countryLabel)
$result = $geolocation::getAddress(51.0363935, 3.7121008);// define result
echo 'Address = ' . $result['label'] . '
';
```