| 253 |
gduche |
1 |
<?php
|
|
|
2 |
// declare(encoding='UTF-8');
|
|
|
3 |
/**
|
|
|
4 |
* Classe gérant les images.
|
|
|
5 |
*
|
|
|
6 |
* @category PHP 5.2
|
|
|
7 |
* @package eflore-consultation
|
|
|
8 |
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
|
|
|
9 |
* @author Delphine CAUQUIL <delphine@tela-botanica.org>
|
|
|
10 |
* @copyright 2011 Tela-Botanica
|
|
|
11 |
* @license http://www.gnu.org/licenses/gpl.html Licence GNU-GPL-v3
|
|
|
12 |
* @license http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL-v2
|
|
|
13 |
* @version $Id$
|
|
|
14 |
*/
|
|
|
15 |
class Cartes extends Eflore {
|
|
|
16 |
|
| 291 |
jpm |
17 |
private $id;
|
| 256 |
gduche |
18 |
private $largeur;
|
| 291 |
jpm |
19 |
|
|
|
20 |
public function setId($id) {
|
|
|
21 |
$this->id = $id;
|
|
|
22 |
}
|
|
|
23 |
|
|
|
24 |
public function setLargeur($largeur) {
|
| 256 |
gduche |
25 |
$this->largeur = $largeur;
|
| 253 |
gduche |
26 |
}
|
| 361 |
delphine |
27 |
|
|
|
28 |
public function setInfoNom($nom) {
|
|
|
29 |
$this->nom = $nom;
|
|
|
30 |
}
|
| 291 |
jpm |
31 |
|
| 263 |
gduche |
32 |
public function getUrlDataSvg() {
|
| 291 |
jpm |
33 |
$tpl = Config::get('carteTpl');
|
|
|
34 |
$params = array('id' => $this->id, 'largeur' => $this->largeur, 'mime-type' => 'image/svg+xml');
|
| 253 |
gduche |
35 |
$url = $this->formaterUrl($tpl, $params);
|
|
|
36 |
return $url;
|
|
|
37 |
}
|
| 291 |
jpm |
38 |
|
| 263 |
gduche |
39 |
public function getUrlPng() {
|
| 291 |
jpm |
40 |
$tpl = Config::get('carteTpl');
|
|
|
41 |
$params = array('id' => $this->id, 'largeur' => $this->largeur, 'mime-type' => 'image/png');
|
| 263 |
gduche |
42 |
$url = $this->formaterUrl($tpl, $params);
|
|
|
43 |
return $url;
|
|
|
44 |
}
|
| 361 |
delphine |
45 |
|
|
|
46 |
public function getUrlMap() {
|
|
|
47 |
$tpl = Config::get('efloreCarteTpl');
|
|
|
48 |
$params = array('num_nom' => $this->nom->get('id'), 'num_tax' => $this->nom->get('num_taxonomique') ,
|
|
|
49 |
'nom_sci' => $this->nom->get('nom_sci'), 'auteur' => $this->nom->get('auteur') ,
|
| 366 |
aurelien |
50 |
'largeur' => $this->largeur, 'mime_type' => 'text/html');
|
| 361 |
delphine |
51 |
$url = $this->formaterUrl($tpl, $params);
|
|
|
52 |
return $url;
|
|
|
53 |
}
|
| 441 |
delphine |
54 |
|
|
|
55 |
public function getUrlEflorePng() {
|
|
|
56 |
$tpl = Config::get('efloreCarteTpl');
|
|
|
57 |
$params = array('num_nom' => $this->nom->get('id'), 'num_tax' => $this->nom->get('num_taxonomique') ,
|
|
|
58 |
'nom_sci' => $this->nom->get('nom_sci'), 'auteur' => $this->nom->get('auteur') ,
|
|
|
59 |
'largeur' => $this->largeur, 'mime_type' => 'image/png');
|
|
|
60 |
$url = $this->formaterUrl($tpl, $params);
|
|
|
61 |
return $url;
|
|
|
62 |
}
|
| 253 |
gduche |
63 |
|
| 367 |
delphine |
64 |
public function getLegendeId() {
|
|
|
65 |
$tpl = Config::get('legendeIdCarteTpl');
|
|
|
66 |
$params = array('id' => $this->id);
|
|
|
67 |
$url = $this->formaterUrl($tpl, $params);
|
|
|
68 |
$donnees = $this->chargerDonnees($url);
|
|
|
69 |
return $donnees;
|
|
|
70 |
}
|
|
|
71 |
|
| 253 |
gduche |
72 |
public function getLegende() {
|
| 291 |
jpm |
73 |
$tpl = Config::get('legendeCarteTpl');
|
| 256 |
gduche |
74 |
$url = $this->formaterUrl($tpl, $params);
|
| 253 |
gduche |
75 |
$donnees = $this->chargerDonnees($url);
|
|
|
76 |
return $donnees;
|
|
|
77 |
}
|
|
|
78 |
|
|
|
79 |
}
|
|
|
80 |
?>
|