GeoLocate() 공개 메소드

GeoLocate Leverages the google maps api to generate a lat/lng pair for a given address packaged with FoursquareApi to facilitate locality searches.
public GeoLocate ( String $addr ) : array(lat,
$addr String An address string accepted by the google maps api
리턴 array(lat,
예제 #1
0
<body>
<h1>Basic Request Example</h1>
<p>
	Search for venues near...
	<form action="" method="GET">
		<input type="text" name="location" />
		<input type="submit" value="Search!" />
	</form>
<p>Searching for venues near <?php 
echo $location;
?>
</p>
<hr />
<?php 
// Generate a latitude/longitude pair using Google Maps API
list($lat, $lng) = $foursquare->GeoLocate($location);
// Prepare parameters
$params = array("ll" => "{$lat},{$lng}");
// Perform a request to a public resource
$response = $foursquare->GetPublic("venues/search", $params);
$venues = json_decode($response);
?>
	
		<?php 
foreach ($venues->response->venues as $venue) {
    ?>
			<div class="venue">
				<?php 
    if (isset($venue->categories['0'])) {
        echo '<image class="icon" src="' . $venue->categories['0']->icon->prefix . '88.png"/>';
    } else {