From 6c9b9835e6fcaf0239c5274c7694f63f995d76dc Mon Sep 17 00:00:00 2001 From: humano Date: Tue, 28 Oct 2014 10:24:48 -0500 Subject: [PATCH] Implemetacion de api basada en json --- milfs/api.json | 88 +++++++++++++++++++++++++++++ milfs/funciones/funciones.php | 101 ++++++++++++++++++++++++++++++++++ 2 files changed, 189 insertions(+) create mode 100644 milfs/api.json diff --git a/milfs/api.json b/milfs/api.json new file mode 100644 index 0000000..13abf68 --- /dev/null +++ b/milfs/api.json @@ -0,0 +1,88 @@ +$lat,'lon'=>$lon); + + $formulario = formulario_imprimir($perfil,$row[control],'full'); + $propiedades["name"] ="
$formulario
"; + + //formulario_imprimir($id,$control) + //$marcador["zoom"] = $zoom; + $geometria .= "{\"type\":\"Feature\",\"geometry\":".json_encode($marcador,JSON_NUMERIC_CHECK).",\"properties\":".json_encode($propiedades,JSON_NUMERIC_CHECK)."},"; + $features[] = $marcador; + //$resultado .= "
  • $row[tipo]
    $row[title]
    $row[description]
  • "; + + $id++; + } + +} +//-75.58295 6.25578 16 + +//encode and output jsonObject +header('Content-Type: application/json'); +//echo $consulta; +$resultado = " { \"type\": \"FeatureCollection\", + \"features\": "; +$resultado .= json_encode($features,JSON_NUMERIC_CHECK); +$resultado .= "}"; +//echo $resultado; +$geometria = substr("$geometria",0,-1); +$geometria = "{ + \"type\": \"FeatureCollection\", + \"features\": [$geometria ]}"; +echo $geometria; + +?> \ No newline at end of file diff --git a/milfs/funciones/funciones.php b/milfs/funciones/funciones.php index 27ae6c1..a2dbb8a 100644 --- a/milfs/funciones/funciones.php +++ b/milfs/funciones/funciones.php @@ -1,4 +1,103 @@ $formulario"; + $propiedades[sounds] =""; + $propiedades[url] =''; + //$propiedades[title] ='Hola mundo'; + //$propiedades[icon][iconUrl] = "images/pin.png"; + $geometria .= "{\"type\":\"Feature\",\"geometry\":".json_encode($marcador,JSON_NUMERIC_CHECK|JSON_PRETTY_PRINT).",\"properties\":".json_encode($propiedades,JSON_NUMERIC_CHECK|JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP | JSON_UNESCAPED_UNICODE|JSON_PRETTY_PRINT)."},"; + $features[] = $marcador; + + $id++; + } + */ + +} +//-75.58295 6.25578 16 + +//encode and output jsonObject +header('Content-Type: text/plain'); +//echo $consulta; + +$resultado = json_encode($features,JSON_NUMERIC_CHECK|JSON_PRETTY_PRINT); + +return $resultado; +} + + function mapa_ficha($id) { @@ -270,6 +369,8 @@ $geometria = "{ \"features\": [$geometria ]}"; return $geometria; } + + function aplicacion_presentacion($id,$div,$timeout){ if($timeout < '1000') {$timeout =5000;}; $respuesta = new xajaxResponse('utf-8');