From c18437388d1810a4f7e8f692d748473feeaebe00 Mon Sep 17 00:00:00 2001 From: arno Date: Wed, 25 Aug 2010 12:02:43 +0200 Subject: [PATCH] gpx export --- application/controllers/GeomController.php | 16 ++++++++++++++++ library/gisconverter | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/application/controllers/GeomController.php b/application/controllers/GeomController.php index f97d016..3f14df9 100644 --- a/application/controllers/GeomController.php +++ b/application/controllers/GeomController.php @@ -67,6 +67,22 @@ class GeomController extends Zend_Controller_Action $api->setCheckIfNoneMatch(true)->setContentType('application/vnd.google-earth.kml+xml')->setBody($data); } + protected function gpx(Syj_Model_Path $path) { + $data = '' . PHP_EOL; // '; + $data .= ''; + if ($path->creator) { + $data .= '' . htmlspecialchars($path->creator->pseudo) . ''; + } + $data .= '' . htmlspecialchars($path->displayTitle) . ''; + $data .= $path->geom->toGPX(); + $data .= ''; + $data .= ''; + + $api = $this->_helper->SyjApi; + $api->setCheckIfNoneMatch(true)->setContentType('application/octet-stream')->setBody($data); + } + protected function json(Syj_Model_Path $path) { $data = array('geom' => (string)$path->geom, 'title' => (string)$path->displayTitle); diff --git a/library/gisconverter b/library/gisconverter index 063610d..bcbe8cf 160000 --- a/library/gisconverter +++ b/library/gisconverter @@ -1 +1 @@ -Subproject commit 063610dca1ee201535e71a63b9e4b5ae92add507 +Subproject commit bcbe8cfed228ed3f5bb13a53ae166ee925ffc417 -- 2.39.2