<?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
}
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);