Subversion Repositories eFlore/Applications.eflore-consultation

Rev

Rev 1329 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1329 Rev 1346
Line 17... Line 17...
17
	private $conteneur = null;
17
	private $conteneur = null;
18
	private $nomCourant = null;
18
	private $nomCourant = null;
19
	private $donnees = array();
19
	private $donnees = array();
20
	private $referentiel = 'bdtfx';
20
	private $referentiel = 'bdtfx';
21
	private $cartes;
21
	private $cartes;
22
	
22
 
23
	public function __construct(Conteneur $conteneur) {
23
	public function __construct(Conteneur $conteneur) {
24
		$this->conteneur = $conteneur;
24
		$this->conteneur = $conteneur;
25
		$this->nomCourant = $this->conteneur->getNomCourant();
25
		$this->nomCourant = $this->conteneur->getNomCourant();
26
		$this->cartes = $this->conteneur->getApiCartes();
26
		$this->cartes = $this->conteneur->getApiCartes();
27
		$this->referentiel = $this->conteneur->getParametre('referentiel');
27
		$this->referentiel = $this->conteneur->getParametre('referentiel');
Line 29... Line 29...
29
 
29
 
30
	public function getDonnees() {
30
	public function getDonnees() {
31
		$donnees['carte'] = $this->getChorodepMiniature();
31
		$donnees['carte'] = $this->getChorodepMiniature();
32
		return $donnees;
32
		return $donnees;
33
	}
33
	}
34
	
34
 
35
	private function getChorodepMiniature() {
35
	private function getChorodepMiniature() {
36
		$url_carte = null;
36
		$url_carte = null;
37
		if(Config::get($this->referentiel.'.baseRepartition') != null) {
37
		if (Config::get($this->referentiel.'.baseRepartition') != null) {
38
			$this->cartes->setProjet(Config::get($this->referentiel.'.baseRepartition'));
38
			$this->cartes->setProjet(Config::get($this->referentiel.'.baseRepartition'));
39
			$this->cartes->setLargeur('570x534');
-
 
40
			//TODO: démochir ce code
-
 
41
			// Chargement des nn des synonymes pour obtenir une carte plus complète
-
 
42
			$noms = $this->conteneur->getApiNoms();
-
 
43
			$syns = $noms->getSynonymes($this->nomCourant->getNnr());
-
 
44
			$nns_syns = array_keys($syns['resultat']);
39
			$this->cartes->setLargeur('570x534');
45
			$nns_syns[] = $this->nomCourant->getNnr();
-
 
46
			$id = 'nn:'.implode(',', $nns_syns);
40
			$nt = $this->nomCourant->getNt();
47
			$this->cartes->setId($id);
41
			$this->cartes->setId("{$this->referentiel}.nt:$nt");
48
			$url_carte = $this->cartes->getUrlDataSvg();
42
			$url_carte = $this->cartes->getUrlDataSvg();
49
		}
43
		}
50
		return $url_carte;
44
		return $url_carte;
51
	}
45
	}