Skip to content

Instantly share code, notes, and snippets.

@Kcko
Last active August 29, 2015 14:05
Show Gist options
  • Save Kcko/7333c7df46157373ef6d to your computer and use it in GitHub Desktop.
Save Kcko/7333c7df46157373ef6d to your computer and use it in GitHub Desktop.
Zjištění LAT / LNG souřadnic - Google maps
<?
function getLatLng($address)
{
$json = json_decode(file_get_contents("http://maps.google.com/maps/api/geocode/json?address=$address&sensor=false"));
$lat = $json->{'results'}[0]->{'geometry'}->{'location'}->{'lat'};
$lng = $json->{'results'}[0]->{'geometry'}->{'location'}->{'lng'};
return array("lat" => $lat, "lng" => $lng);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment