-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from fbonzon/clean
Consistently use 4 spaces instead of tabs
- Loading branch information
Showing
6 changed files
with
658 additions
and
661 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,62 @@ | ||
<?php | ||
/** | ||
* This section includes a sample query that demonstrate features of the API. | ||
* The code below query performs a time zone request for Github's server (San Francisco, California, United States). The timestamp is set to March 8th, 2012. | ||
* | ||
* @author Ivan Melgrati | ||
* @copyright 2016 | ||
* @package GoogleMapsTimeZone | ||
* @author Ivan Melgrati | ||
* @version v1.0.0 stable | ||
*/ | ||
|
||
require_once ('../src/GoogleMapsTimeZone.php'); | ||
|
||
/** | ||
* All queries require an API key from Google | ||
* @link https://developers.google.com/maps/documentation/timezone/get-api-key | ||
* */ | ||
define('API_KEY', 'YOUR API KEY HERE'); | ||
|
||
// Create GoogleMapsTimeZone object with default properties | ||
$timezone_object = new GoogleMapsTimeZone(); | ||
|
||
// Set Google API key | ||
$timezone_object->setApiKey(API_KEY); | ||
|
||
// Set XML as query return format | ||
$timezone_object->setFormat($timezone_object::FORMAT_XML); | ||
|
||
// Set Spanish as query return language | ||
// Check https://developers.google.com/maps/faq#languagesupport for a list of supported languages | ||
$timezone_object->setLanguage('es'); | ||
|
||
// Set latitude (Mexico City International Airport) | ||
$timezone_object->setLatitude(19.4360812); | ||
|
||
// Set longitude (Mexico City International Airport) | ||
$timezone_object->setLongitude(-99.074097); | ||
|
||
// Set Timestamp (server-side current time) | ||
$timezone_object->setTimestamp(time()); | ||
|
||
// Perform query | ||
$timezone_data = $timezone_object->queryTimeZone(); | ||
|
||
echo '<pre>'; | ||
print_r($timezone_data); | ||
echo '</pre>'; | ||
|
||
|
||
// Set XML as query return format | ||
$timezone_object->setFormat($timezone_object::FORMAT_JSON); | ||
// Set Arabic as query return language | ||
// Check https://developers.google.com/maps/faq#languagesupport for a list of supported languages | ||
$timezone_object->setLanguage('ar'); | ||
|
||
// Perform query | ||
$timezone_data = $timezone_object->queryTimeZone(); | ||
|
||
echo '<pre>'; | ||
var_dump($timezone_data); | ||
echo '</pre>'; | ||
?> | ||
|
||
/** | ||
* This section includes a sample query that demonstrate features of the API. | ||
* The code below query performs a time zone request for Github's server (San Francisco, California, United States). The timestamp is set to March 8th, 2012. | ||
* | ||
* @author Ivan Melgrati | ||
* @copyright 2016 | ||
* @package GoogleMapsTimeZone | ||
* @author Ivan Melgrati | ||
* @version v1.2.0 stable | ||
*/ | ||
|
||
require_once('../src/GoogleMapsTimeZone.php'); | ||
|
||
/** | ||
* All queries require an API key from Google. | ||
* @link https://developers.google.com/maps/documentation/timezone/get-api-key | ||
*/ | ||
define('API_KEY', 'YOUR API KEY HERE'); | ||
|
||
// Create GoogleMapsTimeZone object with default properties. | ||
$timezone_object = new GoogleMapsTimeZone(); | ||
|
||
// Set Google API key. | ||
$timezone_object->setApiKey(API_KEY); | ||
|
||
// Set XML as query return format. | ||
$timezone_object->setFormat($timezone_object::FORMAT_XML); | ||
|
||
// Set Spanish as query return language. | ||
// Check https://developers.google.com/maps/faq#languagesupport for a list of supported languages | ||
$timezone_object->setLanguage('es'); | ||
|
||
// Set latitude (Mexico City International Airport). | ||
$timezone_object->setLatitude(19.4360812); | ||
|
||
// Set longitude (Mexico City International Airport). | ||
$timezone_object->setLongitude(-99.074097); | ||
|
||
// Set Timestamp (server-side current time). | ||
$timezone_object->setTimestamp(time()); | ||
|
||
// Perform query | ||
$timezone_data = $timezone_object->queryTimeZone(); | ||
|
||
echo '<pre>'; | ||
print_r($timezone_data); | ||
echo '</pre>'; | ||
|
||
// Set XML as query return format. | ||
$timezone_object->setFormat($timezone_object::FORMAT_JSON); | ||
// Set Arabic as query return language. | ||
// Checkhttps://developers.google.com/maps/faq#languagesupport for a list of supported languages | ||
$timezone_object->setLanguage('ar'); | ||
|
||
// Perform query. | ||
$timezone_data = $timezone_object->queryTimeZone(); | ||
|
||
echo '<pre>'; | ||
var_dump($timezone_data); | ||
echo '</pre>'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,33 @@ | ||
<?php | ||
/** | ||
* This section includes a sample query that demonstrate features of the API. | ||
* The code below query performs a time zone request for Github's server (San Francisco, California, United States). The timestamp is set to March 8th, 2012. | ||
* | ||
* @author Ivan Melgrati | ||
* @copyright 2016 | ||
* @package GoogleMapsTimeZone | ||
* @author Ivan Melgrati | ||
* @version v1.0.0 stable | ||
*/ | ||
|
||
require_once ('../src/GoogleMapsTimeZone.php'); | ||
|
||
/** | ||
* All queries require an API key from Google | ||
* @link https://developers.google.com/maps/documentation/timezone/get-api-key | ||
* */ | ||
define('API_KEY', 'YOUR API KEY HERE'); | ||
/** | ||
* This section includes a sample query that demonstrate features of the API. | ||
* The code below query performs a time zone request for Github's server (San Francisco, California, United States). The timestamp is set to March 8th, 2012. | ||
* | ||
* @author Ivan Melgrati | ||
* @copyright 2016 | ||
* @package GoogleMapsTimeZone | ||
* @author Ivan Melgrati | ||
* @version v1.2.0 stable | ||
*/ | ||
|
||
// Initialize GoogleMapsTimeZone object | ||
$timezone_object = new GoogleMapsTimeZone(37.7697, -122.3933, 1331161200, GoogleMapsTimeZone::FORMAT_JSON); | ||
|
||
// Set Google API key | ||
$timezone_object->setApiKey(API_KEY); | ||
|
||
// Perform query | ||
$timezone_data = $timezone_object->queryTimeZone(); | ||
require_once('../src/GoogleMapsTimeZone.php'); | ||
|
||
echo '<pre>'; | ||
print_r($timezone_data); | ||
echo '</pre>'; | ||
?> | ||
/** | ||
* All queries require an API key from Google. | ||
* @link https://developers.google.com/maps/documentation/timezone/get-api-key | ||
*/ | ||
define('API_KEY', 'YOUR API KEY HERE'); | ||
|
||
// Initialize GoogleMapsTimeZone object. | ||
$timezone_object = new GoogleMapsTimeZone(37.7697, -122.3933, 1331161200, GoogleMapsTimeZone::FORMAT_JSON); | ||
|
||
// Set Google API key. | ||
$timezone_object->setApiKey(API_KEY); | ||
|
||
// Perform query. | ||
$timezone_data = $timezone_object->queryTimeZone(); | ||
|
||
echo '<pre>'; | ||
print_r($timezone_data); | ||
echo '</pre>'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.