* @author Jean-Pascal MILCENT * @author Aurelien PERONNET * @license GPL v3 * @license CECILL v2 * @copyright 1999-2014 Tela Botanica */ class NameMap extends Cel { public function getElement($uid){ $retour = array(''); if (isset($uid[0]) && isset($uid[1])) { $uid[0] = $uid[0] != '' ? $uid[0] : 'bdtfx'; $retour = $this->obtenirCarteChorologie($uid[0], $uid[1]); } $this->envoyerJson($retour); return true; } private function obtenirCarteChorologie($referentiel_taxo, $nn) { // TODO: gérer ici les cartes d'autres référentiels si celles si sont disponibles $chercheur_infos_taxon = new RechercheInfosTaxonBeta($this->config, $referentiel_taxo); $nt = $chercheur_infos_taxon->rechercherNumTaxSurNumNom($nn); $retour = array(''); switch($referentiel_taxo) { case 'bdtfx': $url_service_chorologie = $this->config['eflore']['url_service_chorologie_carte']; $url_service_chorologie = str_replace('{referentiel_choro}','chorodep',$url_service_chorologie); $file = $url_service_chorologie.'/nt%3A'.$nt.'?retour.format=587&retour=image%2Fpng'; $retour = array($file); break; case 'bdtxa': // En attendant mieux $url_service_chorologie = $this->config['eflore']['url_service_chorologie_carte']; $url_service_chorologie = str_replace('{referentiel_choro}','bdtxa',$url_service_chorologie); $file = $url_service_chorologie.'/nt%3A'.$nt.'?retour.format=587&retour=image%2Fpng'; $retour = array($file); break; } return $retour; } }