Kcko
8/28/2014 - 5:25 PM

Zjištění LAT / LNG souřadnic - Google maps

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);

    }