Beispiel #1
0
<?php

require 'vendor/autoload.php';
require 'geocodable.php';
require 'retail_store.php';
$geocoderAdapter = new \Geocoder\HttpAdapter\CurlHttpAdapter();
$geocoderProvider = new \Geocoder\Provider\GoogleMapsProvider($geocoderAdapter);
$geocoder = new \Geocoder\Geocoder($geocoderProvider);
$store = new RetailStore();
// $store->setAddress('420 9th Avenue, New York, NY 10001 USA');
$store->setAddress('Seoul, Korea');
$store->setGeocoder($geocoder);
$latitude = $store->getLatitude();
$longitude = $store->getLongitude();
echo $latitude, ':', $longitude;
Beispiel #2
0
<?php

namespace PHPModern\Traits;

/**
 * Created by PhpStorm.
 * User: junior
 * Date: 12/11/2015
 * Time: 22:14
 */
require_once __DIR__ . "/../../vendor/autoload.php";
$geocoderAdapter = new \Ivory\HttpAdapter\CurlHttpAdapter();
$geocoder = new \Geocoder\Provider\GoogleMaps($geocoderAdapter);
$store = new RetailStore();
$store->setAddress('420 9th Avenue, New York, NY 10001 USA');
$store->setGeocoder($geocoder);
$latitude = $store->getLatitude();
$longitude = $store->getLongitude();
echo $latitude, ':', $longitude;