Subversion Repositories eFlore/Applications.eflore-consultation

Rev

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

Rev 276 Rev 291
Line 12... Line 12...
12
 * @license		http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL-v2
12
 * @license		http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL-v2
13
 * @version		$Id$
13
 * @version		$Id$
14
 */
14
 */
15
class Cartes extends Eflore {
15
class Cartes extends Eflore {
Line 16... Line 16...
16
 
16
 
17
	private $numero;
-
 
18
	private $type; //nt taxonomique ou nn nomenclatural
17
	private $id;
19
	private $largeur;
18
	private $largeur;
20
	
-
 
21
	public function __construct($projet, $numero, $type = 'nt', $largeur = 630) {
19
 
22
		parent::__construct($projet);
20
	public function setId($id) {
-
 
21
		$this->id = $id;
-
 
22
	}
23
		$this->type = $type;
23
 
24
		$this->numero = $numero;
24
	public function setLargeur($largeur) {
25
		$this->largeur = $largeur;
25
		$this->largeur = $largeur;
26
	}
26
	}
27
	
27
 
28
	public function getUrlDataSvg() {
-
 
29
		switch ($this->type) {
-
 
30
			case 'nn' :
-
 
31
				$nomTemplate = 'cartesParNnTpl';
-
 
32
			break;
-
 
33
			case 'nt' : 
-
 
34
				$nomTemplate = 'cartesParNtTpl';
-
 
35
			break;
-
 
36
		}
28
	public function getUrlDataSvg() {
37
		$tpl = Config::get($nomTemplate);
29
		$tpl = Config::get('carteTpl');
38
		$params = array($this->type => $this->numero, 'largeur' => $this->largeur, 'mime-type' => 'image/svg+xml');
30
		$params = array('id' => $this->id, 'largeur' => $this->largeur, 'mime-type' => 'image/svg+xml');
39
		$url = $this->formaterUrl($tpl, $params);
31
		$url = $this->formaterUrl($tpl, $params);
40
		return $url;
32
		return $url;
41
	}
33
	}
42
	
34
 
43
	public function getUrlPng() {
-
 
44
		switch ($this->type) {
-
 
45
			case 'nn' :
-
 
46
				$nomTemplate = 'cartesParNnTpl';
-
 
47
				break;
-
 
48
			case 'nt' :
-
 
49
				$nomTemplate = 'cartesParNtTpl';
-
 
50
				break;
-
 
51
		}
35
	public function getUrlPng() {
52
		$tpl = Config::get($nomTemplate);
36
		$tpl = Config::get('carteTpl');
53
		$params = array($this->type => $this->numero, 'largeur' => $this->largeur, 'mime-type' => 'image/png');
37
		$params = array('id' => $this->id, 'largeur' => $this->largeur, 'mime-type' => 'image/png');
54
		$url = $this->formaterUrl($tpl, $params);
38
		$url = $this->formaterUrl($tpl, $params);
55
		return $url;
39
		return $url;
Line 56... Line 40...
56
	}
40
	}
57
 
-
 
58
	public function getLegende() {
-
 
59
		switch ($this->type) {
-
 
60
			case 'nn' :
-
 
61
				$nomTemplate = 'legendeCartesParNnTpl';
-
 
62
			break;
-
 
63
			case 'nt' : 
-
 
64
				$nomTemplate = 'legendeCartesParNtTpl';
-
 
65
			break;
41
 
66
		}
42
	public function getLegende() {
67
		$tpl = Config::get($nomTemplate);
43
		$tpl = Config::get('legendeCarteTpl');
68
		$params = array($this->type => $this->numero);
44
		$params = array('id' => $this->id);
69
		$url = $this->formaterUrl($tpl, $params);
-
 
70
		$donnees = $this->chargerDonnees($url);
45
		$url = $this->formaterUrl($tpl, $params);
71
		
46
		$donnees = $this->chargerDonnees($url);
Line 72... Line 47...
72
		return $donnees;
47
		return $donnees;
73
	}
48
	}
74
 
49