Subversion Repositories eFlore/Applications.eflore-consultation

Rev

Rev 253 | Rev 257 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 253 Rev 256
Line 14... Line 14...
14
 */
14
 */
15
class Cartes extends Eflore {
15
class Cartes extends Eflore {
Line 16... Line 16...
16
 
16
 
17
	private $numero;
17
	private $numero;
-
 
18
	private $type; //nt taxonomique ou nn nomenclatural
Line 18... Line 19...
18
	private $type; //nt taxonomique ou nn nomenclatural
19
	private $largeur;
19
	
20
	
20
	public function __Construct($numero, $type = 'nt') {
21
	public function __Construct($numero, $type = 'nt', $largeur = 630) {
-
 
22
		$this->type = $type;
21
		$this->type = $type;
23
		$this->numero = $numero;
Line 22... Line 24...
22
		$this->numero = $numero;
24
		$this->largeur = $largeur;
23
	}
25
	}
24
	
26
	
Line 30... Line 32...
30
			case 'nt' : 
32
			case 'nt' : 
31
				$nomTemplate = 'urlChorologieParNtTpl';
33
				$nomTemplate = 'urlChorologieParNtTpl';
32
			break;
34
			break;
33
		}
35
		}
34
		$tpl = Config::get($nomTemplate);
36
		$tpl = Config::get($nomTemplate);
35
		$params = array($this->type => $this->numero);
37
		$params = array($this->type => $this->numero, 'largeur' => $this->largeur);
36
		$url = $this->formaterUrl($tpl, $params);
38
		$url = $this->formaterUrl($tpl, $params);
37
		
-
 
38
		return $url;
39
		return $url;
39
	}
40
	}
Line 40... Line 41...
40
 
41
 
41
	public function getLegende() {
42
	public function getLegende() {
42
		switch ($this->type) {
43
		switch ($this->type) {
43
			case 'nn' :
44
			case 'nn' :
44
				$nomTemplate = 'urlChorologieParNnTpl';
45
				$nomTemplate = 'legendeChorologieParNnTpl';
45
			break;
46
			break;
46
			case 'nt' : 
47
			case 'nt' : 
47
				$nomTemplate = 'urlChorologieParNtTpl';
48
				$nomTemplate = 'legendeChorologieParNtTpl';
48
			break;
49
			break;
49
		}
50
		}
50
		$tpl = Config::get($nomTemplate);
51
		$tpl = Config::get($nomTemplate);
51
		$params = array($this->type => $this->numero);
52
		$params = array($this->type => $this->numero);
52
		$url = $this->formaterUrl($tpl."/legende", $params);
53
		$url = $this->formaterUrl($tpl, $params);
53
		$donnees = $this->chargerDonnees($url);
54
		$donnees = $this->chargerDonnees($url);
54
		return $donnees;
55
		return $donnees;
Line 55... Line 56...
55
	}
56
	}