56,7 → 56,7 |
public $src_map; |
private $cartesFormateur = null; |
const MIME_MAP = 'text/html'; |
const MIME_JPG = 'image/jpeg'; |
const MIME_PNG = 'image/png'; |
|
public function consulter($ressources, $param) { |
// Initialisation des variables |
72,7 → 72,7 |
// Connection referentiel communes |
$this->chargerVille(); |
list($text, $merge) = $this->calculerRepartition($inventories); |
// D�finition des couleurs des points |
// Définition des couleurs des points |
$couleurs = $this->cartesFormateur->definirCouleurs(); |
if ($text) { |
$usemap = $this->cartesFormateur->dessinerPoint($text, $merge, $couleurs); |
87,7 → 87,7 |
} |
$resultat = new ResultatService(); |
$resultat->corps = ($this->info['retour'] == self::MIME_MAP) ? $retour : file_get_contents($retour); |
$resultat->mime = ($this->info['retour'] == self::MIME_MAP) ? self::MIME_MAP : self::MIME_JPG; |
$resultat->mime = ($this->info['retour'] == self::MIME_MAP) ? self::MIME_MAP : self::MIME_PNG; |
return $resultat; |
} |
|
111,9 → 111,9 |
|
private function traiterParametres() { |
$this->info['miniature'] = (isset($this->param['retour.format'])) ? $this->param['retour.format'] : false; |
$this->info['src_map'] = ($this->info['miniature'] == 'min') ? 'france_utm_miniature.jpg' : 'france_utm_600x564.jpg'; |
$this->info['retour'] = (isset($this->param['retour'])) ? $this->param['retour'] : self::MIME_JPG ; |
// Ajout du code du r�f�rentiel |
$this->info['src_map'] = ($this->info['miniature'] == 'min') ? 'france_utm_miniature.png' : 'france_utm_600x564.png'; |
$this->info['retour'] = (isset($this->param['retour'])) ? $this->param['retour'] : self::MIME_PNG ; |
// Ajout du code du référentiel |
$this->info['referentiel'] = 'bdtfx'; |
$projets = array('cenlr', 'cel', 'cbnmed', 'sophy', 'general'); |
if (isset($this->param['projet']) && in_array($this->param['projet'], $projets)) { |
121,7 → 121,7 |
} else { |
$this->info['projet'] = 'general'; |
} |
// R�cup�ration d'infos g�n�rales |
// Récupération d'infos générales |
// donnees exemple nn = 141; nt = 8522; nom = 'Acer campestre L.'; nom_ss_auteur = 'Acer campestre'; |
$this->info['nn'] = $this->param['masque.nn']; |
$this->info['nt'] = $this->param['masque.nt']; |
140,9 → 140,9 |
private function calculerRepartition($inventories) { |
$text = ''; |
// Recuperation du positionnement de la carte |
$jpg_txt = file_get_contents(Config::get('Cartes.chemin').str_replace('jpg', 'txt', $this->info['src_map'])); |
parse_str($jpg_txt); |
// "Resolution" calculer à partir du fichier $jpg_txt par fuseau |
$png_txt = file_get_contents(Config::get('Cartes.chemin').str_replace('png', 'txt', $this->info['src_map'])); |
parse_str($png_txt); |
// "Resolution" calculer à partir du fichier $png_txt par fuseau |
$p['31T'] = ($X231T - $X131T) / ($X231TUTM - $X131TUTM); |
$p['32T'] = ($X231T - $X131T ) / ($X231TUTM - $X131TUTM); |
$p['30T'] = ($X231T - $X131T ) / ($X231TUTM - $X131TUTM); |
192,7 → 192,7 |
} |
$comment = ($this->info['retour'] == self::MIME_MAP) ? $this->cartesFormateur->formerCommentaire($utm, $inventory) : ''; |
// On stocke les commentaires pour affichage dans les tooltips |
// Commentaire deja pr�sent ? : on ajoute � la suite |
// Commentaire deja présent ? : on ajoute à la suite |
list($text, $merge) = $this->cartesFormateur->stockerCommentaire($text, $merge, $name, $comment, $inventory['collection_code'],$x,$y); |
} |
} |
206,7 → 206,7 |
$this->cheminCartesBase = Config::get('Cartes.chemin'); |
$dest_map['vide'] = 'vide_'.$this->info['src_map']; |
$img['vide'] = imagecreatefromjpeg($this->cheminCartesBase.$this->info['src_map']); |
imagejpeg($img['vide'], Config::get('cache.stockageChemin').$dest_map['vide'], 90); |
imagepng($img['vide'], Config::get('cache.stockageChemin').$dest_map['vide'], 9); |
$retour = Config::get('cel_dst').$dest_map['vide']; |
if ($this->info['retour'] == self::MIME_MAP) { |
$retour = "<img src=\"".$retour."\" style=\"border:none; cursor:crosshair\" alt=\"\" />\n"; |