X-Git-Url: https://dev.renevier.net/gitweb.cgi?a=blobdiff_plain;f=application%2Fcontrollers%2FIdxController.php;h=790c8c766348edd0f88205b23670ee96db772c3d;hb=69cbaf628f5576754d4553c021315188e22d24af;hp=3996fa04e8e6c5c4adfc7de65293b0627c382cbf;hpb=a86eeac0ab678ea55307e1386c5f955f77d8ff73;p=syj.git diff --git a/application/controllers/IdxController.php b/application/controllers/IdxController.php index 3996fa0..790c8c7 100644 --- a/application/controllers/IdxController.php +++ b/application/controllers/IdxController.php @@ -66,9 +66,17 @@ class IdxController extends Zend_Controller_Action $geomform->geom_title->setValue($path->title); } else { $geomform->setAction('path'); - $clientip = trim(end(split(',', $this->getRequest()->getClientIp(true)))); - $extent = new phptojs\JsObject('gMaxExtent', $this->_helper->syjGeoip($clientip)); - $this->view->headScript()->prependScript((string) $extent); + + $lat = $this->getRequest()->getQuery('lat'); + $lon = $this->getRequest()->getQuery('lon'); + $zoom = $this->getRequest()->getQuery('zoom'); + if (is_numeric ($lat) and is_numeric ($lon) and is_numeric ($zoom)) { + $initialpos = array('lat' => (float)$lat, 'lon' => (float)$lon, 'zoom' => (int)$zoom); + } else { + $initialpos = $this->_helper->syjGeoip($this->getRequest()->getClientIp(true)); + } + + $this->view->headScript()->prependScript((string) new phptojs\JsObject('gInitialPos', $initialpos)); $title = "Show your journey"; } @@ -79,6 +87,7 @@ class IdxController extends Zend_Controller_Action $this->view->translate('route by %s', (string)$path->creator->pseudo); } $this->view->headTitle($title); + $this->view->headMeta()->appendName('description', $this->view->translate('website to share routes')); $this->view->geomform = $geomform; $this->view->loginform = $loginform; $this->view->userform = $userform;