| Line 16... |
Line 16... |
| 16 |
|
16 |
|
| 17 |
private $conteneur = null;
|
17 |
private $conteneur = null;
|
| 18 |
private $nomCourant = null;
|
18 |
private $nomCourant = null;
|
| 19 |
private $referentiel = 'bdtfx';
|
19 |
private $referentiel = 'bdtfx';
|
| 20 |
private $donnees = array();
|
- |
|
| 21 |
private $tailleBloc = "190x178";
|
- |
|
| 22 |
private $serviceChorodep = null;
|
20 |
private $donnees = array();
|
| 23 |
private $cartes;
|
21 |
private $cartes;
|
| 24 |
private $meta;
|
22 |
private $meta;
|
| Line 25... |
Line 23... |
| 25 |
private $appUrls;
|
23 |
private $appUrls;
|
| Line 52... |
Line 50... |
| 52 |
$donnees['eflore'] = $this->donnees['moissonnage'];
|
50 |
$donnees['eflore'] = $this->donnees['moissonnage'];
|
| 53 |
return $donnees;
|
51 |
return $donnees;
|
| 54 |
}
|
52 |
}
|
| Line 55... |
Line 53... |
| 55 |
|
53 |
|
| 56 |
private function getRepartition() {
|
54 |
private function getRepartition() {
|
| 57 |
$projetRepartition = Config::get($this->referentiel.'.baseRepartition');
|
55 |
$projetRepartition = Config::get("{$this->referentiel}.baseRepartition");
|
| 58 |
// eg: eflore ou chorodep
|
56 |
// eg: eflore ou chorodep
|
| 59 |
// cf: bdtfx.ini, bdtxa.ini
|
57 |
// cf: bdtfx.ini, bdtxa.ini
|
| 60 |
if ($projetRepartition != '') {
|
58 |
if ($projetRepartition != '') {
|
| 61 |
$this->cartes->setProjet($projetRepartition);
|
59 |
$this->cartes->setProjet($projetRepartition);
|
| 62 |
$this->cartes->setLargeur('630');
|
60 |
$this->cartes->setLargeur('630');
|
| 63 |
$nt = $this->conteneur->getNomCourant()->getNt();
|
- |
|
| 64 |
$referentiel = $this->conteneur->getParametre('referentiel');
|
61 |
$nt = $this->nomCourant->getNt();
|
| 65 |
$this->cartes->setId("$referentiel.nn:$nt");
|
62 |
$this->cartes->setId("{$this->referentiel}.nt:$nt");
|
| 66 |
$repartition['svgUrl'] = $this->cartes->getUrlDataSvg();
|
63 |
$repartition['svgUrl'] = $this->cartes->getUrlDataSvg();
|
| 67 |
$repartition['pngUrl'] = $this->cartes->getUrlPng();
|
64 |
$repartition['pngUrl'] = $this->cartes->getUrlPng();
|
| 68 |
$repartition['legende'] = $this->cartes->getLegendeId();
|
65 |
$repartition['legende'] = $this->cartes->getLegendeId();
|
| 69 |
$this->meta->setProjet($projetRepartition);
|
66 |
$this->meta->setProjet($projetRepartition);
|
| Line 120... |
Line 117... |
| 120 |
$donnees['eflore'] = $this->getMoissonnageMiniature();
|
117 |
$donnees['eflore'] = $this->getMoissonnageMiniature();
|
| Line 121... |
Line 118... |
| 121 |
|
118 |
|
| 122 |
// TODO: moche, comment gérer le fait que l'onglet "synthèse", en "bdtxa", doive
|
119 |
// TODO: moche, comment gérer le fait que l'onglet "synthèse", en "bdtxa", doive
|
| 123 |
// afficher la carte chorologie, et non la carte chorodep.
|
120 |
// afficher la carte chorologie, et non la carte chorodep.
|
| 124 |
// workaround: écrasement de l'URL dans ['répartition']['chorodep']:
|
121 |
// workaround: écrasement de l'URL dans ['répartition']['chorodep']:
|
| 125 |
if($this->referentiel == 'bdtxa') {
|
122 |
if ($this->referentiel == 'bdtxa') {
|
| 126 |
$syns = $this->conteneur->getApiNoms()->getSynonymes($this->nomCourant->getNnr());
|
123 |
$nt = $this->nomCourant->getNt();
|
| 127 |
$nns_syns = array_keys($syns['resultat']);
|
124 |
$idCarte = "{$this->referentiel}.nt:$nt";
|
| - |
|
125 |
$urlCarte = Config::get("{$this->referentiel}.baseRepartition");
|
| 128 |
$nns_syns[] = $this->nomCourant->getNnr();
|
126 |
|
| 129 |
$donnees['chorodep'] = Cartes::getCarteUrlPng(Config::get($this->referentiel.'.baseRepartition'),
|
- |
|
| 130 |
'nn:'.implode(',', $nns_syns),
|
- |
|
| 131 |
'190x178');
|
127 |
$donnees['chorodep'] = Cartes::getCarteUrlPng($urlCarte, $idCarte, '190x178');
|
| Line 132... |
Line 128... |
| 132 |
}
|
128 |
}
|
| 133 |
|
129 |
|
| Line 134... |
Line 130... |
| 134 |
return $donnees;
|
130 |
return $donnees;
|
| 135 |
}
|
131 |
}
|
| 136 |
|
132 |
|
| 137 |
private function getChorodepMiniature() {
|
133 |
private function getChorodepMiniature() {
|
| 138 |
$projetRepartition = Config::get($this->referentiel.'.baseRepartition');
|
134 |
$projetRepartition = Config::get("{$this->referentiel}.baseRepartition");
|
| 139 |
$url = null;
|
135 |
$url = null;
|
| 140 |
if ($projetRepartition != "") {
|
136 |
if ($projetRepartition != '') {
|
| 141 |
$this->cartes->setProjet($projetRepartition);
|
- |
|
| 142 |
$this->cartes->setProjet('chorodep');
|
- |
|
| 143 |
$this->cartes->setLargeur('190x178');
|
- |
|
| 144 |
//TODO: démochir ce code
|
- |
|
| 145 |
// Chargement des nn des synonymes pour obtenir une carte plus complète
|
- |
|
| - |
|
137 |
$this->cartes->setProjet($projetRepartition);
|
| 146 |
$noms = $this->conteneur->getApiNoms();
|
138 |
$this->cartes->setProjet('chorodep');
|
| 147 |
$syns = $noms->getSynonymes($this->nomCourant->getNnr());
|
- |
|
| 148 |
$nns_syns = array_keys($syns['resultat']);
|
139 |
$this->cartes->setLargeur('190x178');
|
| - |
|
140 |
|
| 149 |
$nns_syns[] = $this->nomCourant->getNnr();
|
141 |
$nt = $this->nomCourant->getNt();
|
| 150 |
$id = 'nn:'.implode(',', $nns_syns);
|
142 |
$this->cartes->setId("{$this->referentiel}.nt:$nt");
|
| 151 |
$this->cartes->setId($id);
|
143 |
|
| 152 |
$url = $this->cartes->getUrlPng();
|
144 |
$url = $this->cartes->getUrlPng();
|
| Line 153... |
Line 145... |
| 153 |
}
|
145 |
}
|
| 154 |
return $url;
|
146 |
return $url;
|
| 155 |
}
|
147 |
}
|
| 156 |
|
148 |
|
| 157 |
private function getMoissonnageMiniature() {
|
149 |
private function getMoissonnageMiniature() {
|
| 158 |
$projetMoissonnage = Config::get($this->referentiel.'.baseMoissonnage');
|
150 |
$projetMoissonnage = Config::get($this->referentiel.'.baseMoissonnage');
|
| 159 |
$url = null;
|
151 |
$url = null;
|
| 160 |
if ($projetMoissonnage != "") {
|
152 |
if ($projetMoissonnage != '') {
|
| 161 |
$this->cartes->setProjet('moissonnage');
|
153 |
$this->cartes->setProjet('moissonnage');
|