Exemple #1
0
 function test_all()
 {
     $address = "Av. Mal. Floriano Peixoto, 44 - Gonzaga, Santos - São Paulo, 11060-300, Brazil";
     //$address = "sd;lksdl;skdl;skd";
     $geocode = new Geocode($address);
     $lat = $geocode->address();
     echo "<pre>";
     print_r($geocode->state());
     echo "</pre>";
 }
Exemple #2
0
 private function geo_cinema($cinema)
 {
     $endereco = $cinema->address;
     $geocode = new Geocode($endereco);
     $cinema->address = $geocode->address();
     $cinema->lat = $geocode->lat();
     $cinema->long = $geocode->long();
     $cinema->city = $geocode->city();
     $estado = $geocode->state();
     if ($estado) {
         $cinema->state = $estado['name'];
         $cinema->state_code = $estado['short'];
     } else {
         $cinema->state = '';
         $cinema->state_code = '';
     }
     return $cinema;
 }