]> git.mxchange.org Git - friendica.git/commitdiff
API: Return the geo coordinates
authorMichael Vogel <icarus@dabo.de>
Tue, 23 Jun 2015 05:32:14 +0000 (07:32 +0200)
committerMichael Vogel <icarus@dabo.de>
Tue, 23 Jun 2015 05:32:14 +0000 (07:32 +0200)
include/api.php

index d1132635d32ca8572882ef91445d697bc1cc66e2..b5d8f9cf3d8c5d7407a319897bdb488e8061513a 100644 (file)
                        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;
                };