Welcome Guest, Not a member yet? Register   Sign In
geo coding
#3

[eluser]watanuki[/eluser]
Newbie need help please...

I want to translate location into longitude and latitude, I have tried to modify my code as mention by ehicks727, but the result still negative.

here is my code:

Code:
function locate(){
$place=$_REQUEST['place'];
if($place){
       $data=$this->gcode($place);
    $this->load->view('map/show_map',$data);
    $this->load->view('footer_view');
    }else{
      $this->load->view('map/map_err');
      $this->load->view('footer_view');
        }
    }

function gcode($location) {
        $url = 'http://local.yahooapis.com/MapsService/V1/geocode?appid=[my_appid]'.
                '&location;='.rawurlencode($location).
                '&output=php';
        $response = file_get_contents($url);
        if ($response === false) return false;
            //die('Request failed');
        $phpobj = array_change_key_case(array_shift(array_shift(unserialize($response))));
        return $phpobj;
    }

if I echo $data['longitude'] and $data['latitude'], it's always empty.. Any suggestion?


Messages In This Thread
geo coding - by El Forum - 08-27-2008, 06:35 AM
geo coding - by El Forum - 08-27-2008, 07:18 AM
geo coding - by El Forum - 01-11-2010, 01:33 PM



Theme © iAndrew 2016 - Forum software by © MyBB