issue #001668 : Mouvement en degré
This commit is contained in:
parent
6c54456fe0
commit
47230bdd6f
@ -1189,28 +1189,33 @@ class IdentiteController extends Zend_Controller_Action
|
||||
{
|
||||
$request = $this->getRequest();
|
||||
|
||||
if ( $request->isXmlHttpRequest() ) {
|
||||
$this->_helper->layout()->disableLayout();
|
||||
}
|
||||
|
||||
$lat = $request->getParam('lat', '');
|
||||
$lon = $request->getParam('lon', '');
|
||||
$heading = $request->getParam('heading', 0);
|
||||
$num = $request->getParam('heading', 0);
|
||||
|
||||
$streetview = new Scores_Streetview();
|
||||
if ( $lat != '' && $lon != '' ) {
|
||||
if ( $lat != '' && $lon != '' ) {
|
||||
$deg = $streetview->getNumDeg();
|
||||
$nbImg = count($deg);
|
||||
$pagePrec = $num-1;
|
||||
if ($pagePrec<=0) {
|
||||
$pagePrec = $nbImg-1;
|
||||
}
|
||||
$pageSuiv = $num+1;
|
||||
if($pageSuiv>=$nbImg) {
|
||||
$pageSuiv = 0;
|
||||
}
|
||||
$this->view->assign('pagePrec', $pagePrec);
|
||||
$this->view->assign('pageSuiv', $pageSuiv);
|
||||
$streetview->setLocationGeo( $lat, $lon );
|
||||
$heading = $deg[$num];
|
||||
$streetview->setHeading($heading);
|
||||
//$streetview->setLocationTxt($adresse);
|
||||
$this->view->assign('url', $streetview->urlImg());
|
||||
|
||||
$nbImg = $streetview->getNumDeg();
|
||||
$pagePrec = $heading-1;
|
||||
if ($pagePrec<reset($nbImg)) {
|
||||
$pagePrec = end($nbImg);
|
||||
}
|
||||
$pageSuiv = $heading+1;
|
||||
if($pageSuiv>end($nbImg)) {
|
||||
$pageSuiv = reset($nbImg);
|
||||
}
|
||||
$this->view->assign('pagePrec', $pagePrec);
|
||||
$this->view->assign('pageSuiv', $pageSuiv);
|
||||
}
|
||||
$this->view->assign('lat', $lat);
|
||||
$this->view->assign('lon', $lon);
|
||||
|
@ -57,7 +57,7 @@ class Scores_Streetview
|
||||
$deg = 360/$this->nbImage;
|
||||
$i=$calc=0;
|
||||
while ($calc<360) {
|
||||
$mark[] = $i;
|
||||
$mark[$i] = $calc;
|
||||
$calc+=$deg;
|
||||
$i++;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user