2017 © Pedro Peláez
 

library geo-adapter

Library to use different geolocalization adapter

image

ideato/geo-adapter

Library to use different geolocalization adapter

  • Tuesday, December 10, 2013
  • by cphp
  • Repository
  • 4 Watchers
  • 14 Stars
  • 233 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 5 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

GeoAdapter

With GeoAdapter you can find a location from an address. A location is a object with latitude and longitude attribute. Location object implements a method can calculate distance between two location., (*1)

``` php <?php, (*2)

require_once DIR . '/../vendor/autoload.php';, (*3)

$search = new Geo\Search(); $search->addService(new Geo\Service\OpenStreetMap\Nominatim());, (*4)

$search->query('Milano'); $location_a = $search->getFirst();, (*5)

$search->query('Firenze'); $location_b = $search->getFirst();, (*6)

echo 'Address1: via Montenapoleone, Milano'.PHP_EOL; echo 'Latitude: '.$location_a->getLatitude().PHP_EOL; echo 'Longitude: '.$location_a->getLongitude().PHP_EOL.PHP_EOL;, (*7)

echo 'Address2: piazza Boccolino, Osimo'.PHP_EOL; echo 'Latitude: '.$location_b->getLatitude().PHP_EOL; echo 'Longitude: '.$location_b->getLongitude().PHP_EOL.PHP_EOL;, (*8)

$distance = $location_a->distance($location_b);, (*9)

echo "Distance from Milano to Firenze is $distance Km".PHP_EOL; ```, (*10)

This software is released under GPL license., (*11)

The Versions

10/12 2013

dev-master

9999999-dev https://github.com/francescotrucchia/GeoAdapter

Library to use different geolocalization adapter

  Sources   Download

GPL

The Requires

  • php >=5.3.0

 

15/11 2013

v1.0.0

1.0.0.0 https://github.com/francescotrucchia/GeoAdapter

Library to use different geolocalization adapter

  Sources   Download

GPL

The Requires

  • php >=5.3.0