From 7e4fc930b4435fcc54838e1e42898493e3734769 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Tue, 23 Jun 2015 07:32:14 +0200 Subject: [PATCH] API: Return the geo coordinates --- include/api.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/include/api.php b/include/api.php index d1132635d3..b5d8f9cf3d 100644 --- a/include/api.php +++ b/include/api.php @@ -2236,9 +2236,14 @@ unset($status["user"]["uid"]); unset($status["user"]["self"]); - // 'geo' => array('type' => 'Point', - // 'coordinates' => array((float) $notice->lat, - // (float) $notice->lon)); + if ($item["coord"] != "") { + $coords = explode(' ',$item["coord"]); + if (count($coords) == 2) { + $status["geo"] = array('type' => 'Point', + 'coordinates' => array((float) $coords[0], + (float) $coords[1])); + } + } $ret[] = $status; };