From 979b28f76d1db801940e89a72329d1dcebb72a26 Mon Sep 17 00:00:00 2001 From: fredyrivera Date: Sun, 24 Sep 2017 07:55:37 -0500 Subject: [PATCH] correcion en nominatim --- milfs/funciones/funciones.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/milfs/funciones/funciones.php b/milfs/funciones/funciones.php index add335e..626e4fb 100644 --- a/milfs/funciones/funciones.php +++ b/milfs/funciones/funciones.php @@ -4251,8 +4251,11 @@ function geocoder($valor,$campo){ $respuesta = new xajaxResponse('utf-8'); if(strlen($valor) > 3) { $valor = urlencode($valor); -$json = "https://nominatim.openstreetmap.org/search.php?format=json&limit=5&addressdetails=1&q=$valor"; +$json = "https://nominatim.openstreetmap.org/search.php?format=json&limit=5&addressdetails=1&q=$valor&email=info@tupale.co"; $data = file_get_contents("$json"); +if ($data=='429 Too Many Requests'){ +return $data; +} $geocoder = json_decode($data, true); if($data ==="[]") {$vacio="