]> dev.renevier.net Git - syj.git/blobdiff - application/controllers/GeomController.php
update copyright headers
[syj.git] / application / controllers / GeomController.php
index 3f14df907137d7cbab2ec8a83f695ba3d140b653..0c399fedd89684f989e17bb860b4e62222117351 100644 (file)
@@ -1,5 +1,5 @@
 <?php
-/*  This file is part of Syj, Copyright (c) 2010 Arnaud Renevier,
+/*  This file is part of Syj, Copyright (c) 2010-2011 Arnaud Renevier,
     and is published under the AGPL license. */
 
 class GeomController extends Zend_Controller_Action
@@ -84,10 +84,10 @@ class GeomController extends Zend_Controller_Action
     }
 
     protected function json(Syj_Model_Path $path) {
-        $data = array('geom' => (string)$path->geom,
-                  'title' => (string)$path->displayTitle);
+        $data = json_decode($path->geom->toGeoJSON());
+        $data->title = (string)$path->displayTitle;
         if ($path->creator) {
-            $data['creator'] = (string)$path->creator->pseudo;
+            $data->creator = (string)$path->creator->pseudo;
         }
         $api = $this->_helper->SyjApi;
         $api->setCheckIfNoneMatch(true)->setBodyJson($data);