Advertisement
Guest User

Untitled

a guest
Jul 17th, 2017
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. Route::post('/geolocate', function(){
  2.  
  3. /*if(Request::ajax()){
  4.  
  5. return('entra');
  6.  
  7. $direccion = Request::get('address');
  8. $direccion = urlencode($direccion);
  9.  
  10. $url = "http://maps.google.com/maps/api/geocode/json?sensor=false&address=" . $direccion;
  11. $response = file_get_contents($url);
  12. $json = json_decode($response,true);
  13.  
  14. $lat = $json['results'][0]['geometry']['location']['lat'];
  15. $lng = $json['results'][0]['geometry']['location']['lng'];
  16.  
  17. $array = array($lat, $lng);
  18.  
  19.  
  20. echo json_encode($array);
  21. }*/
  22.  
  23. return 'end' ;
  24. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement