/branches/v2.9-motobineuse/widget/modules/cartopoint/CartoPoint.php |
---|
New file |
0,0 → 1,246 |
<?php |
// declare(encoding='UTF-8'); |
/** |
* Service fournissant une carte dynamique des obsertions publiques du CEL. |
* Encodage en entrée : utf8 |
* Encodage en sortie : utf8 |
* |
* Cas d'utilisation et documentation : |
* @link http://www.tela-botanica.org/wikini/eflore/wakka.php?wiki=AideCELWidgetCarto |
* |
* Paramètres : |
* ===> utilisateur = identifiant |
* Affiche seulement les observations d'un utilisateur donné. L'identifiant correspond au courriel de |
* l'utilisateur avec lequel il s'est inscrit sur Tela Botanica. |
* ===> dept = code_du_département |
* Affiche seulement les observations pour le département français métropolitain indiqué. Les codes de département utilisables |
* sont : 01 à 19, 2A, 2B et 21 à 95. |
* ===> projet = mot-clé |
* Affiche seulement les observations pour le projet d'observations indiqué. Dans l'interface du CEL, vous pouvez taguer vos |
* observations avec un mot-clé de projet. Si vous voulez regrouper des observations de plusieurs utilisateurs, communiquez un |
* mot-clé de projet à vos amis et visualisez les informations ainsi regroupées. |
* ===> num_taxon = num_taxon |
* Affiche seulement les observations pour la plante indiquée. Le num_taxon correspond au numéro taxonomique de la plante. |
* Ce numéro est disponible dans les fiches d'eFlore. Par exemple, pour "Poa bulbosa L." le numéro taxonomique vaut 7080. |
* |
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org> |
* @license GPL v3 <http://www.gnu.org/licenses/gpl.txt> |
* @license CECILL v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt> |
* @version $Id$ |
* @copyright Copyright (c) 2010, Tela Botanica (accueil@tela-botanica.org) |
*/ |
class Cartopoint extends WidgetCommun { |
const DS = DIRECTORY_SEPARATOR; |
const SERVICE_CARTO_NOM = 'CelWidgetMapPoint'; |
const SERVICE_CARTO_ACTION_DEFAUT = 'carte-defaut'; |
private $carte = null; |
private $utilisateur = null; |
private $projet = null; |
private $dept = null; |
private $num_taxon = null; |
private $station = null; |
private $format = null;// Format des obs pour les stations (tableau/liste) |
private $photos = null; // Seulement les obs avec photos ou bien toutes |
private $titre = null; // Indication s'il faut le titre par défaut, personnalisé ou bien sans titre |
private $logo = null; // url du logo à ajouter si nécessaire |
private $url_site = null; // url du site auquel le logo est lié |
private $image = null; // url d'une image à ajouter dans l'interface |
private $nbjours = null; // nombre de jour à partir de la date courate pour lesquels on affiche les points |
private $annee = null; // filtre par année |
private $referentiel = null; // nombre de jour à partir de la date courate pour lesquels on affiche les points |
/** |
* Méthode appelée par défaut pour charger ce widget. |
*/ |
public function executer() { |
$retour = null; |
$this->extraireParametres(); |
$methode = $this->traiterNomMethodeExecuter($this->carte); |
if (method_exists($this, $methode)) { |
$retour = $this->$methode(); |
} else { |
$this->messages[] = "Ce type de service '$methode' n'est pas disponible."; |
} |
if (is_null($retour)) { |
$info = 'Un problème est survenu : '.print_r($this->messages, true); |
$this->envoyer($info); |
} else { |
$squelette = dirname(__FILE__).self::DS.'squelettes'.self::DS.$retour['squelette'].'.tpl.html'; |
$html = $this->traiterSquelettePhp($squelette, $retour['donnees']); |
$this->envoyer($html); |
} |
} |
public function extraireParametres() { |
extract($this->parametres); |
$this->carte = (isset($carte) ? $carte : self::SERVICE_CARTO_ACTION_DEFAUT); |
$this->utilisateur = (isset($utilisateur) ? $utilisateur : '*'); |
$this->projet = (isset($projet) ? $projet : '*'); |
$this->tag = (isset($tag) ? $tag : '*'); |
$this->tag = (isset($motcle) ? $motcle : $this->tag); |
$this->dept = (isset($dept) ? $dept : '*'); |
$this->commune = (isset($commune) ? $commune : '*'); |
$this->num_taxon = (isset($num_taxon) ? $num_taxon : '*'); |
$this->date = (isset($date) ? $date : '*'); |
$this->taxon = (isset($taxon) ? $taxon : '*'); |
$this->commentaire = (isset($commentaire) ? $commentaire : null); |
$this->station = (isset($station) ? $station : null); |
$this->format = (isset($format) ? $format : null); |
$this->photos = (isset($photos) ? $photos : null); |
$this->titre = (isset($titre) ? urldecode($titre) : null); |
$this->logo = (isset($logo) ? urldecode($logo) : null); |
$this->url_site = (isset($url_site) ? urldecode($url_site) : null); |
$this->image = (isset($image) ? urldecode($image) : null); |
$this->nbjours = (isset($nbjours) ? urldecode($nbjours) : null); |
$this->annee = (isset($annee) ? urldecode($annee) : null); |
$this->referentiel = (isset($referentiel) ? urldecode($referentiel) : null); |
$this->start = (isset($start) ? $start : null); |
$this->limit = (isset($limit) ? $limit : null); |
} |
/** |
* Carte par défaut |
*/ |
public function executerCarteDefaut() { |
$widget = null; |
$url_stations = $this->contruireUrlServiceCarto('stations'); |
$url_base = sprintf($this->config['chemins']['baseURLAbsoluDyn'], ''); |
// Création des infos du widget |
$widget['donnees']['url_cel_carto'] = $this->contruireUrlServiceCarto(); |
$widget['donnees']['url_stations'] = $url_stations; |
$widget['donnees']['url_base'] = $url_base; |
$widget['donnees']['utilisateur'] = $this->utilisateur; |
$widget['donnees']['projet'] = $this->projet; |
$widget['donnees']['tag'] = $this->tag; |
$widget['donnees']['dept'] = $this->dept; |
$widget['donnees']['commune'] = $this->commune; |
$widget['donnees']['num_taxon'] = $this->num_taxon; |
$widget['donnees']['date'] = $this->date; |
$widget['donnees']['taxon'] = $this->taxon; |
$widget['donnees']['commentaire'] = $this->commentaire; |
$widget['donnees']['photos'] = $this->photos; |
$widget['donnees']['titre'] = $this->titre; |
$widget['donnees']['logo'] = $this->logo; |
$widget['donnees']['url_site'] = $this->url_site; |
$widget['donnees']['image'] = $this->image; |
$widget['donnees']['nbjours'] = $this->nbjours; |
$widget['donnees']['annee'] = $this->annee; |
$widget['donnees']['referentiel'] = $this->referentiel; |
$widget['donnees']['url_limites_communales'] = $this->obtenirUrlsLimitesCommunales(); |
$widget['donnees']['communeImageUrl'] = $this->config['carto']['communeImageUrl']; |
$widget['donnees']['pointImageUrl'] = $this->config['carto']['pointImageUrl']; |
$widget['donnees']['groupeImageUrlTpl'] = $this->config['carto']['groupeImageUrlTpl']; |
$widget['donnees']['url_widget_saisie'] = $this->config['urls']['widgetSaisie']; |
$widget['squelette'] = 'carte_defaut'; |
return $widget; |
} |
private function contruireUrlServiceCarto($action = null) { |
// Création url données json |
$url = sprintf($this->config['chemins']['baseURLServicesCelTpl'], self::SERVICE_CARTO_NOM); |
if ($action) { |
$url .= "/$action"; |
$parametres_retenus = array(); |
$parametres_a_tester = array('station', 'utilisateur', 'projet', 'tag', 'dept', 'commune', |
'num_taxon', 'taxon', 'date', 'commentaire', 'nbjours', 'referentiel', |
'start', 'limit'); |
foreach ($parametres_a_tester as $param) { |
if (isset($this->$param) && $this->$param != '*') { |
$parametres_retenus[$param] = $this->$param; |
} |
} |
if (count($parametres_retenus) > 0) { |
$parametres_url = array(); |
foreach ($parametres_retenus as $cle => $valeur) { |
$parametres_url[] = $cle.'='.$valeur; |
} |
$url .= '?'.implode('&', $parametres_url); |
} |
} |
return $url; |
} |
private function obtenirUrlsLimitesCommunales() { |
$urls = null; |
if (isset($this->dept)) { |
// si on veut afficher les limites départementales on va compter et chercher les noms de fichiers |
$fichiersKml = $this->chercherFichierKml(); |
if (count($fichiersKml) > 0) { |
foreach ($fichiersKml as $kml => $dossier){ |
$url_limites_communales = sprintf($this->config['carto']['limitesCommunaleUrlTpl'], $dossier, $kml); |
$urls[] = $url_limites_communales; |
} |
} |
} |
$urls = json_encode($urls); |
return $urls; |
} |
private function chercherFichierKml(){ |
$fichiers = array(); |
if (isset($this->config['carto']['communesKmzChemin'])) { |
$chemins = explode(',', $this->config['carto']['communesKmzChemin']); |
$departements = explode(',', $this->dept);// plrs code de départements peuvent être demandés séparés par des virgules |
$departements_trouves = array(); |
foreach ($chemins as $dossier_chemin) { |
if ($dossier_ressource = opendir($dossier_chemin)) { |
while ($element = readdir($dossier_ressource)) { |
if ($element != '.' && $element != '..') { |
foreach ($departements as $departement) { |
$nom_dossier = basename($dossier_chemin); |
if (!isset($departements_trouves[$departement]) || $departements_trouves[$departement] == $nom_dossier) { |
$dept_protege = preg_quote($departement); |
if (!is_dir($dossier_chemin.'/'.$element) && preg_match("/^$dept_protege(?:_[0-9]+|)\.km[lz]$/", $element)) { |
$fichiers[$element] = $nom_dossier; |
$departements_trouves[$departement] = $nom_dossier; |
} |
} |
} |
} |
} |
closedir($dossier_ressource); |
} |
} |
} else { |
$this->messages[] = 'Veuillez configurer le paramètres carto.communesKmzChemin.'; |
} |
return $fichiers; |
} |
/** |
* Afficher message d'avertissement. |
*/ |
public function executerAvertissement() { |
$widget = null; |
// Création des infos du widget |
$widget['donnees']['contenu_aide'] = $this->chargerAideWiki(); |
$widget['donnees']['url_base'] = sprintf($this->config['chemins']['baseURLAbsoluDyn'], ''); |
$widget['squelette'] = 'avertissement'; |
return $widget; |
} |
/** |
* Charge le contenu du wikini demandé |
*/ |
function chargerAideWiki() { |
$url = str_replace('{page}','AideCarto',$this->config['carto']['aideWikiniUrlCartoPoint']); |
$infos_aide = file_get_contents($url); |
$aide = ''; |
if($infos_aide != null && $infos_aide != '') { |
$infos_aide = json_decode($infos_aide); |
$infos_aide = (is_a($infos_aide, 'StdClass') && $infos_aide->texte != null) ? $infos_aide->texte : ''; |
} |
return $infos_aide; |
} |
} |
?> |
/branches/v2.9-motobineuse/widget/modules/cartopoint/config.defaut.ini |
---|
New file |
0,0 → 1,12 |
[urls] |
widgetSaisie = "http://www.tela-botanica.org/widget:cel:saisie"; |
[carto] |
; Chemin vers le dossier contenant les fichiers kmz des limites communales |
communesKmzChemin = "/home/telabotap/www/commun/google/map/3/kmz/communes/,/home/telabotap/www/commun/google/map/3/kmz/communes_incompletes/" |
; Template de l'url où charger les fichiers kml des limites communales. |
limitesCommunaleUrlTpl = "http://www.tela-botanica.org/eflore/cel2/widget/modules/carto/squelettes/kml/%s/%s" |
communeImageUrl = "http://www.tela-botanica.org/commun/icones/carto/commune.png" |
pointImageUrl = "http://www.tela-botanica.org/commun/icones/carto/point2.png" |
groupeImageUrlTpl = "http://www.tela-botanica.org/service:cel:CelWidgetMapPoint/icone-groupe?type={type}&nbre={nbre}" |
aideWikiniUrlCartoPoint = "http://www.tela-botanica.org/wikini/eflore/api/rest/0.5/pages/{page}?txt.format=text/html"; |
/branches/v2.9-motobineuse/widget/modules/cartopoint/squelettes/images/trie_croissant.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
/branches/v2.9-motobineuse/widget/modules/cartopoint/squelettes/images/trie_croissant.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+image/png |
\ No newline at end of property |
/branches/v2.9-motobineuse/widget/modules/cartopoint/squelettes/images/saisie.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
/branches/v2.9-motobineuse/widget/modules/cartopoint/squelettes/images/saisie.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+image/png |
\ No newline at end of property |
/branches/v2.9-motobineuse/widget/modules/cartopoint/squelettes/images/chargement.gif |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/branches/v2.9-motobineuse/widget/modules/cartopoint/squelettes/images/chargement.gif |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/branches/v2.9-motobineuse/widget/modules/cartopoint/squelettes/images/fermeture.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
/branches/v2.9-motobineuse/widget/modules/cartopoint/squelettes/images/fermeture.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+image/png |
\ No newline at end of property |
/branches/v2.9-motobineuse/widget/modules/cartopoint/squelettes/images/chargement_transparent.gif |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/branches/v2.9-motobineuse/widget/modules/cartopoint/squelettes/images/chargement_transparent.gif |
---|
New file |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/branches/v2.9-motobineuse/widget/modules/cartopoint/squelettes/images/plein_ecran.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
/branches/v2.9-motobineuse/widget/modules/cartopoint/squelettes/images/plein_ecran.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+image/png |
\ No newline at end of property |
/branches/v2.9-motobineuse/widget/modules/cartopoint/squelettes/images/ouverture.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
/branches/v2.9-motobineuse/widget/modules/cartopoint/squelettes/images/ouverture.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+image/png |
\ No newline at end of property |
/branches/v2.9-motobineuse/widget/modules/cartopoint/squelettes/images/trie_decroissant.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
/branches/v2.9-motobineuse/widget/modules/cartopoint/squelettes/images/trie_decroissant.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+image/png |
\ No newline at end of property |
/branches/v2.9-motobineuse/widget/modules/cartopoint/squelettes/images/trie.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
/branches/v2.9-motobineuse/widget/modules/cartopoint/squelettes/images/trie.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+image/png |
\ No newline at end of property |
/branches/v2.9-motobineuse/widget/modules/cartopoint/squelettes/images/attention.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
/branches/v2.9-motobineuse/widget/modules/cartopoint/squelettes/images/attention.png |
---|
New file |
Property changes: |
Added: svn:executable |
+* |
\ No newline at end of property |
Added: svn:mime-type |
+image/png |
\ No newline at end of property |
/branches/v2.9-motobineuse/widget/modules/cartopoint/squelettes/images/information.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = image/png |
/branches/v2.9-motobineuse/widget/modules/cartopoint/squelettes/images/information.png |
---|
New file |
Property changes: |
Added: svn:mime-type |
+image/png |
\ No newline at end of property |
/branches/v2.9-motobineuse/widget/modules/cartopoint/squelettes/obs_msg_info.tpl.html |
---|
New file |
0,0 → 1,3 |
<p id="obs-msg-info"> |
Les observations de cette carte sont regroupées par commune. |
</p> |
/branches/v2.9-motobineuse/widget/modules/cartopoint/squelettes/carte_defaut.tpl.html |
---|
New file |
0,0 → 1,420 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
<html xmlns="http://www.w3.org/1999/xhtml"> |
<head> |
<title>Observations publiques du CEL - Tela Botanica</title> |
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/> |
<meta http-equiv="Content-style-type" content="text/css" /> |
<meta http-equiv="Content-script-type" content="text/javascript" /> |
<meta http-equiv="Content-language" content="fr" /> |
<meta name="revisit-after" content="15 days" /> |
<meta name="robots" content="index,follow" /> |
<meta name="author" content="Tela Botanica" /> |
<meta name="keywords" content="Tela Botanica, cartographie, CEL" /> |
<meta name="description" content="Widget de cartographie des observations publiques de plantes saisies dans le Carnet en Ligne (CEL)" /> |
<!-- OpenGraph pour Facebook, Pinterest, Google+ --> |
<meta property="og:type" content="website" /> |
<meta property="og:title" content="Cartographie des observations publiques du CeL" /> |
<meta property="og:site_name" content="Tela Botanica" /> |
<meta property="og:description" content="Représentation cartographique des observations publiques du Carnet en Ligne" /> |
<meta property="og:image" content="http://resources.tela-botanica.org/tb/img/256x256/carre_englobant.png" /> |
<meta property="og:image:type" content="image/png" /> |
<meta property="og:image:width" content="256" /> |
<meta property="og:image:height" content="256" /> |
<meta property="og:locale" content="fr_FR" /> |
<!-- Spécial mobile --> |
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> |
<!-- Favicones --> |
<link rel="icon" type="image/png" href="http://www.tela-botanica.org/sites/commun/generique/images/favicones/tela_botanica.png" /> |
<link rel="shortcut icon" type="image/x-icon" href="http://www.tela-botanica.org/sites/commun/generique/images/favicones/tela_botanica.ico" /> |
<!-- Javascript : bibliothèques --> |
<!-- Google Map v3 --> |
<script type="text/javascript" src="http://maps.google.com/maps/api/js?v=3.5&sensor=true&language=fr&region=FR"></script> |
<script type="text/javascript" src="http://www.tela-botanica.org/commun/google/map/3/markermanager/1.0/markermanager-1.0.pack.js"></script> |
<!-- Jquery --> |
<script type="text/javascript" src="http://www.tela-botanica.org/commun/jquery/1.6.2/jquery-1.6.2.min.js"></script> |
<script type="text/javascript" src="http://www.tela-botanica.org/commun/jquery/jquery-ui/1.8.15/js/jquery-ui-1.8.15.custom.min.js"></script> |
<script type="text/javascript" src="http://www.tela-botanica.org/commun/jquery/tablesorter/2.0.5/jquery.tablesorter.min.js"></script> |
<script type="text/javascript" src="http://www.tela-botanica.org/commun/jquery/fancybox/1.3.4/jquery.fancybox-1.3.4.pack.js"></script> |
<script type="text/javascript" src="http://www.tela-botanica.org/commun/jquery/pagination/2.2/jquery.pagination.js"></script> |
<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jquery.templates/beta1/jquery.tmpl.min.js"></script> |
<script type="text/javascript" src="http://www.tela-botanica.org/commun/jquery/validate/1.8.1/jquery.validate.min.js"></script> |
<script type="text/javascript" src="http://www.tela-botanica.org/commun/jquery/validate/1.8.1/messages_fr.js"></script> |
<!-- Javascript : appli carto --> |
<script type="text/javascript"> |
//<![CDATA[ |
var urlWidgetSaisie = '<?= $url_widget_saisie; ?>', |
urlsLimitesCommunales = '<?= $url_limites_communales; ?>', |
nt = '<?=$num_taxon?>', |
filtreCommun = |
'&taxon=<?=rawurlencode($taxon)?>'+ |
'&utilisateur=<?=$utilisateur?>'+ |
'&projet=<?=rawurlencode($projet)?>'+ |
'&tag=<?=rawurlencode($tag)?>'+ |
'&date=<?=$date?>'+ |
'&dept=<?=$dept?>'+ |
'&commune=<?=rawurlencode($commune)?>'+ |
'&commentaire=<?=rawurlencode($commentaire)?>', |
utilisateur = '<?=$utilisateur?>', |
photos = '<?= ($photos != null) ? $photos : "null"; ?>'; |
if (photos != null) { |
filtreCommun += '&photos=<?=rawurlencode($photos)?>'; |
} |
var nbJours = '<?= ($nbjours != null) ? $nbjours : "null"; ?>'; |
if (nbJours != null) { |
filtreCommun += '&nbjours=<?=rawurlencode($nbjours)?>'; |
} |
var annee = '<?= ($annee != null) ? $annee : "null"; ?>'; |
if (annee != null) { |
filtreCommun += '&annee=<?=rawurlencode($annee)?>'; |
} |
var referentiel = '<?= ($referentiel != null) ? $referentiel : "null"; ?>'; |
if (referentiel != null) { |
filtreCommun += '&referentiel=<?=rawurlencode($referentiel)?>'; |
} |
var titreCarte = '<?= ($titre != null) ? addslashes($titre) : "null"; ?>', |
urlLogo = '<?= ($logo != null) ? $logo : "null"; ?>', |
urlSite = '<?= ($url_site != null) ? $url_site : "null"; ?>', |
urlImage = '<?= ($image != null) ? $image : "null"; ?>', |
stationsUrl = '<?=$url_cel_carto?>/tout'+'?' + 'num_taxon=' + nt + filtreCommun, |
taxonsUrl = '<?=$url_cel_carto?>/taxons'+'?' + 'num_taxon=' + nt + filtreCommun, |
observationsUrl = '<?=$url_cel_carto?>/observations' + '?' + |
'station={stationId}'+ |
'&num_taxon={nt}'+ |
filtreCommun, |
communeImageUrl = '<?= $communeImageUrl; ?>', |
pointImageUrl = '<?= $pointImageUrl; ?>', |
groupeImageUrlTpl = '<?= $groupeImageUrlTpl; ?>'; |
//]]> |
</script> |
<script type="text/javascript" src="<?=$url_base?>modules/cartopoint/squelettes/scripts/carto.js"></script> |
<!-- CSS --> |
<link rel="stylesheet" href="http://www.tela-botanica.org/commun/jquery/fancybox/1.3.4/jquery.fancybox-1.3.4.css" type="text/css" media="screen" /> |
<link rel="stylesheet" href="http://www.tela-botanica.org/commun/jquery/jquery-ui/1.8.15/css/smoothness/jquery-ui-1.8.15.custom.css" type="text/css" media="screen" /> |
<link href="<?=$url_base?>modules/cartopoint/squelettes/css/<?=isset($_GET['style']) ? $_GET['style'] : 'carto'?>.css" rel="stylesheet" type="text/css" media="screen" /> |
</head> |
<body> |
<div id="zone-chargement-point" class="element-overlay"> |
<img id="img-chargement" src="<?=$url_base?>modules/cartopoint/squelettes/images/chargement_transparent.gif" alt="Chargement en cours..." /> |
<div id="legende-chargement">Chargement des points en cours...</div> |
</div> |
<?php if($logo != null) { ?> |
<div id="logo"> |
<?php if($url_site != null) { ?> |
<a href="<?= $url_site; ?>" |
title="<?= $url_site; ?>" |
onclick="ouvrirNouvelleFenetre(this, event)"> |
<img height="60px" class="image-logo" src="<?= $logo ?>" alt="logo" /> |
</a> |
<?php } else { ?> |
<img class="image-logo" src="<?= $logo ?>" alt="logo" /> |
<?php } ?> |
</div> |
<?php } else { ?> |
<div id="logo"> |
<a href="http://www.tela-botanica.org/site:accueil" |
title="Aller à l'accueil de Tela Botanica" |
onclick="ouvrirNouvelleFenetre(this, event)"> |
<img height="60px" class="image-logo" src="http://resources.tela-botanica.org/tb/img/128x128/logo_carre_officiel.png" alt="TB" /> |
</a> |
</div> |
<?php } ?> |
<?php if($titre !== "0" && $titre != null) : ?> |
<div id="zone-titre" class="element-overlay"> |
<h1 id="carte-titre"> |
<span id="carte-titre-infos"><?= htmlspecialchars($titre); ?></span> |
</h1> |
</div> |
<?php endif; ?> |
<? if ($num_taxon == '*') : ?> |
<div id="panneau-lateral" class="element-overlay <?= ($titre != 0) ? 'carte_titree"': 'carte_non_titree"'; ?>> |
<div id="pl-ouverture" title="Filtrer les observations par espèce"> |
<span>Panneau >></span> |
<div id="pl-indication-filtre"> Filtrer |
</div> |
</div> |
<div id="pl-fermeture" title="Fermer le panneau latéral"><span><< Fermer [x]</span></div> |
<div id="pl-contenu"> |
<div id="pl-entete"> |
<h2>Filtre sur <span class="plantes-nbre"> </span> plantes</h2> |
<p> |
Cliquez sur un nom de plante pour filtrer les observations sur la carte.<br /> |
Pour revenir à l'état initial, cliquez à nouveau sur le nom sélectionné. |
</p> |
</div> |
<hr class="nettoyage" /> |
<div id="pl-corps" onMouseOver="map.setOptions({'scrollwheel':false});" onMouseOut="map.setOptions({'scrollwheel':true});"> |
<hr class="nettoyage" /> |
<!-- Insertion des lignes à partir du squelette tpl-taxons-liste --> |
<span class="raz-filtre-taxons taxon-actif" title="Voir tous les taxons"> |
Voir tous les taxons |
</span> |
<ol id="taxons"> |
</ol> |
</div> |
</div> |
</div> |
<? endif ?> |
<div id="carte" <?= ($titre != 0) ? 'class="carte_titree"': 'class="carte_non_titree"'; ?>></div> |
<div id="lien_plein_ecran" class="element-overlay"> |
<a href="#" title="Voir en plein écran (s'ouvre dans une nouvelle fenêtre)"> |
<img class="icone" src="<?=$url_base?>modules/cartopoint/squelettes/images/plein_ecran.png" alt="Voir en plein écran" /> |
</a> |
</div> |
<div id="zone-stats" style="display:none" class="element-overlay"> |
<h1> |
</h1> |
</div> |
<div id="conteneur-filtre-utilisateur" class="ferme element-overlay"> |
<div id="lien-affichage-filtre-utilisateur">Ma carte</div> |
<div id="formulaire-filtre-utilisateur"> |
<span class="indication-filtre-utilisateur">Affichez la carte |
de vos observations</span> |
<input type="text" id="filtre-utilisateur" placeholder="entrez votre email" value="<?= ($utilisateur != '*') ? $utilisateur : '' ?>" title="entrez l'email d'un utilisateur pour voir ses données" /> |
<input id="valider-filtre-utilisateur" type="button" value="ok" /> |
<a href="#" id="raz-filtre-utilisateur">Voir la carte globale</a> |
</div> |
</div> |
<?php if($image != null) { ?> |
<div id="image-utilisateur"> |
<img width="155px" src="<?= $image ?>" alt="image" /> |
</div> |
<?php } ?> |
<div id="origine-donnees"> |
Observations du réseau <a href="http://www.tela-botanica.org/site:botanique" |
onClick="ouvrirNouvelleFenetre(this, event)"> |
Tela Botanica |
</a> |
- Carte : <a href="http://www.openstreetmap.org/copyright" target="_blank">© les contributeurs d’OpenStreetMap</a> |
- Tuiles : <a href="http://www.openstreetmap.fr" target="_blank">OsmFr</a> |
</div> |
<div id="lien-voir-cc" class="element-overlay"> |
<a href="<?=$url_base?>cartoPoint?carte=avertissement" title="Voir les informations et conditions d'utilisation de ce widget"> |
? |
</a> |
</div> |
<!-- Blocs chargés à la demande : par défaut avec un style display à none --> |
<!-- Squelette du message de chargement des observations --> |
<script id="tpl-chargement" type="text/x-jquery-tmpl"> |
<div id="chargement" style="height:300px;"> |
<img src="<?=$url_base?>modules/cartopoint/squelettes/images/chargement.gif" alt="Chargement en cours..." /> |
<p>Chargement des observations en cours...</p> |
</div> |
</script> |
<!-- Squelette du contenu d'une info-bulle observation --> |
<script id="tpl-obs" type="text/x-jquery-tmpl"> |
<div id="info-bulle" style="width:{largeur}px;"> |
<div id="obs"> |
<h2 id="obs-station-titre">Station</h2> |
<div class="navigation"> </div> |
<div> |
<ul> |
<li><a href="#obs-vue-tableau">Tableau</a></li> |
<li><a href="#obs-vue-liste">Liste</a></li> |
</ul> |
</div> |
<div id="observations"> |
<div id="obs-vue-tableau" style="display:none;"> |
<table id="obs-tableau"> |
<thead> |
<tr> |
<th title="Nom scientifique défini par l'utilisateur.">Nom</th> |
<th title="Date de l'observation">Date</th> |
<th title="Lieu d'observation">Lieu</th> |
<th title="Auteur de l'observation">Observateur</th> |
</tr> |
</thead> |
<tbody id="obs-tableau-lignes" class="obs-conteneur"> |
<!-- Insertion des lignes à partir du squelette tpl-obs-tableau --> |
</tbody> |
</table> |
</div> |
<div id="obs-vue-liste" style="display:none;"> |
<ol id="obs-liste-lignes" class="obs-conteneur"> |
<!-- Insertion des lignes à partir du squelette tpl-obs-liste --> |
</ol> |
</div> |
</div> |
<div id="obs-pieds-page"> |
<p>Id : <span id="obs-station-id"> </span></p> |
</div> |
<div class="navigation"> </div> |
<div class="conteneur-lien-saisie" style="display:none;"> |
<a href="#" class="lien-widget-saisie"> |
Ajouter une observation pour ce site |
</a> |
</div> |
</div> |
</div> |
</script> |
<!-- Squelette du contenu du tableau des observation --> |
<script id="tpl-obs-tableau" type="text/x-jquery-tmpl"> |
<tr class="cel-obs-${idObs}"> |
<td> |
<span class="nom-sci"> |
{{if nn != null && nn != 0 && nn != ''}} |
<a href="${urlEflore}" |
onclick="ouvrirNouvelleFenetre(this, event)"> |
${nomSci} |
</a> |
{{else}} |
${nomSci} |
{{/if}} |
</span> |
</td> |
<td class="date">{{if date}}${date}{{else}} {{/if}}</td> |
<td class="lieu">{{if lieu}}${lieu}{{else}} {{/if}}</td> |
<td> |
{{if observateur}} |
{{if observateurId}} |
<a class="contact obs-${idObs} contributeur-${observateurId}" |
href="#form-contact" |
title="Contactez ce contributeur"> |
${observateur} |
</a> |
{{else}} |
<a class="contact obs-${idObs}" |
href="#form-contact" |
title="Contactez ce contributeur"> |
${observateur} |
</a> |
{{/if}} |
{{else}} |
|
{{/if}} |
</td> |
</tr> |
</script> |
<!-- Squelette du contenu de la liste des observations --> |
<script id="tpl-obs-liste" type="text/x-jquery-tmpl"> |
<li> |
<div class="cel-obs-${idObs}"> |
{{if images}} |
{{each(index, img) images}} |
<div{{if index == 0}} class="cel-img-principale" {{else}} class="cel-img-secondaire"{{/if}}> |
<a class="cel-img" |
href="${img.normale}" |
title="${nomSci} {{if nn != null && nn != 0 && nn != ''}} [${nn}] {{/if}} par ${observateur} - Publiée le ${datePubli} - GUID : ${img.guid}" |
rel="cel-obs-${idObs}"> |
<img src="${img.miniature}" alt="Image #${img.idImg} de l'osbervation #${nn}" /> |
</a> |
<p id="cel-info-${img.idImg}" class="cel-infos"> |
<a class="cel-img-titre" href="${urlEflore}" |
onclick="window.open(this.href);return false;" |
title="Cliquez pour accéder à la fiche eFlore"> |
<strong>${nomSci} {{if nn}} [nn${nn}] {{/if}}</strong> par <em>${observateur}</em> |
</a> |
<br /> |
<span class="cel-img-date">Publiée le ${datePubli}</span> |
</p> |
</div> |
{{/each}} |
{{/if}} |
<dl> |
<dt class="champ-nom-sci">Nom</dt> |
<dd title="Nom défini par l'utilisateur{{if nn != 0}}. Cliquez pour accéder à la fiche d'eFlore.{{/if}}"> |
<span class="nom-sci"> |
{{if nn != null && nn != 0 && nn != ''}} |
<a href="${urlEflore}" |
onclick="ouvrirNouvelleFenetre(this, event)"> |
${nomSci} |
</a> |
{{else}} |
${nomSci} |
{{/if}} |
</span> |
</dd> |
<dt title="Lieu d'observation">Lieu</dt><dd class="lieu"> ${lieu}</dd> |
<dt title="Date d'observation">Le</dt><dd class="date"> ${date}</dd> |
<dt title="Auteur de l'observation">Publié par</dt> |
<dd> |
{{if observateur}} |
{{if observateurId}} |
<a class="contact obs-${idObs} contributeur-${observateurId}" |
href="#form-contact" |
title="Contactez ce contributeur"> |
${observateur} |
</a> |
{{else}} |
<a class="contact obs-${idObs}" |
href="#form-contact" |
title="Contactez ce contributeur"> |
${observateur} |
</a> |
{{/if}} |
{{else}} |
|
{{/if}} |
</dd> |
</dl> |
<hr class="nettoyage"/> |
</div> |
</li> |
</script> |
<!-- Squelette de la liste des taxons --> |
<script id="tpl-taxons-liste" type="text/x-jquery-tmpl"> |
{{each(index, taxon) taxons}} |
<li id="taxon-${taxon.nt}"> |
<span class="taxon" title="Numéro taxonomique : ${taxon.nt} - Famille : ${taxon.famille}"> |
${taxon.nom} <span class="nt" title="Numéro taxonomique">${taxon.nt}</span> |
</span> |
</li> |
{{/each}} |
</ol> |
</script> |
<!-- Squelette du formulaire de contact --> |
<div id="tpl-form-contact" style="display:none;"> |
<form id="form-contact" method="post" action=""> |
<div id="fc-zone-dialogue"></div> |
<dl> |
<dt><label for="fc_sujet">Sujet</label></dt> |
<dd><input id="fc_sujet" name="fc_sujet"/></dd> |
<dt><label for="fc_message">Message</label></dt> |
<dd><textarea id="fc_message" name="fc_message"></textarea></dd> |
<dt><label for="fc_utilisateur_courriel" title="Utilisez le courriel avec lequel vous êtes inscrit à Tela Botanica">Votre courriel</label></dt> |
<dd><input id="fc_utilisateur_courriel" name="fc_utilisateur_courriel"/></dd> |
</dl> |
<p> |
<input id="fc_destinataire_id" name="fc_destinataire_id" type="hidden" value="" /> |
<input id="fc_copies" name="fc_copies" type="hidden" value="eflore_remarques@tela-botanica.org" /> |
<input type="hidden" name="fc_type_envoi" id="fc_type_envoi" value="inscrit" /> |
<button id="fc_annuler" type="button">Annuler</button> |
|
<button id="fc_effacer" type="reset">Effacer</button> |
|
<input id="fc_envoyer" type="submit" value="Envoyer" /> |
</p> |
</form> |
</div> |
<!-- Stats : Google Analytics --> |
<script type="text/javascript"> |
//<![CDATA[ |
var _gaq = _gaq || []; |
_gaq.push(['_setAccount', 'UA-20092557-1']); |
_gaq.push(['_trackPageview']); |
(function() { |
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; |
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; |
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); |
})(); |
//]]> |
</script> |
</body> |
</html> |
/branches/v2.9-motobineuse/widget/modules/cartopoint/squelettes/scripts/carto.js |
---|
New file |
0,0 → 1,1444 |
/*+--------------------------------------------------------------------------------------------------------+*/ |
// PARAMÊTRES et CONSTANTES |
/** |
* Indication de certaines variables ajoutée par php |
* var communeImageUrl ; |
* var pointImageUrl ; |
* var groupeImageUrlTpl ; |
*/ |
var DEBUG = false,// Mettre à true pour afficher les messages de débogage |
pointsOrigine = null, |
boundsOrigine = null, |
markerClusterer = null, |
map = null, |
infoBulle = new google.maps.InfoWindow(), |
stations = null, |
pointClique = null, |
carteCentre = new google.maps.LatLng(25, 10), |
carteOptions = { |
zoom: 3, |
center:carteCentre, |
mapTypeId: 'OSM', |
mapTypeControlOptions: { |
mapTypeIds: ['OSM', |
google.maps.MapTypeId.ROADMAP, |
google.maps.MapTypeId.HYBRID, |
google.maps.MapTypeId.SATELLITE, |
google.maps.MapTypeId.TERRAIN] |
}, |
scaleControl: true, |
zoomControlOptions: { |
style: google.maps.ZoomControlStyle.LARGE, |
position: google.maps.ControlPosition.LEFT_CENTER |
}, |
panControl: false |
}, |
osmMapType = new google.maps.ImageMapType({ |
getTileUrl: function(coord, zoom) { |
return "http://osm.tela-botanica.org/tuiles/osmfr/" + // cache de tuiles avec nginx |
zoom + "/" + coord.x + "/" + coord.y + ".png"; |
}, |
tileSize: new google.maps.Size(256, 256), |
isPng: true, |
alt: "OpenStreetMap", |
name: "OSM", |
maxZoom: 19 |
}), |
ctaLayer = null, |
pagineur = {'limite':300, 'start':0, 'total':0, 'stationId':null, 'format':'tableau'}, |
station = {'commune':'', 'obsNbre':0}, |
obsStation = new Array(), |
obsPage = new Array(), |
taxonsCarte = new Array(), |
mgr = null, |
marqueursCache = new Array(), |
zonesCache = new Array(), |
requeteChargementPoints, |
urlVars = null; |
/*+--------------------------------------------------------------------------------------------------------+*/ |
// INITIALISATION DU CODE |
//Déclenchement d'actions quand JQuery et le document HTML sont OK |
$(document).ready(function() { |
initialiserWidget(); |
}); |
function initialiserWidget() { |
urlVars = getUrlVars(); |
dimensionnerCarte(); |
definirTailleOverlay(); |
initialiserCarte(); |
attribuerListenersOverlay(); |
centrerTitreEtStats(); |
initialiserAffichagePanneauLateral(); |
initialiserGestionnaireMarqueurs() |
initialiserInfoBulle(); |
initialiserFormulaireContact(); |
chargerLimitesCommunales(); |
attribuerListenerCarte(); |
} |
function getUrlVars() { |
var vars = [], hash; |
if (window.location.href.indexOf('?') != -1) { |
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); |
for (var i = 0; i < hashes.length; i++) { |
hash = hashes[i].split('='); |
vars.push(hash[0]); |
vars[hash[0]] = hash[1]; |
} |
} |
return vars; |
} |
/*+--------------------------------------------------------------------------------------------------------+*/ |
// AFFICHAGE GÉNÉRAL |
function afficherTitreCarteEtStats() { |
if (stations != null && taxonsCarte.length > 0) { |
var obsNbre = stations.stats.observations; |
var obsNbreFormate = obsNbre; |
if(obsNbre != 0) { |
obsNbreFormate = stations.stats.observations.formaterNombre(); |
} |
var plteNbre = taxonsCarte.length; |
var plteNbreFormate = plteNbre; |
if (plteNbre != 0) { |
plteNbreFormate = taxonsCarte.length.formaterNombre(); |
} |
var communeNbre = stations.stats.communes; |
var communeNbreFormate = communeNbre; |
if(communeNbre != 0) { |
communeNbreFormate = stations.stats.communes.formaterNombre(); |
} |
var stationNbre = stations.stats.stations; |
var stationNbreFormate = stationNbre; |
if(stationNbre != 0) { |
stationNbreFormate = stations.stats.stations.formaterNombre(); |
} |
var stats = obsNbreFormate+' observation'; |
stats += (obsNbre > 1) ? 's' : '' ; |
if (photos != null && photos == 1) { |
stats += ' avec photos '; |
} |
stats += ' sur '+(stationNbre+ communeNbre)+' station'; |
stats += (stationNbre > 1) ? 's' : '' ; |
if (nt == '*') { |
stats += ' parmi '+plteNbreFormate+' taxon'; |
stats += (plteNbre > 1) ? 's' : '' ; |
} else { |
if($('.taxon-actif .taxon').text() != '') { |
var element = $('.taxon-actif .taxon').clone(); |
element.children().remove(); |
var taxon = element.text(); |
stats += ' pour '+taxon; |
} else { |
if (taxonsCarte[0]) { |
var taxon = taxonsCarte[0]; |
stats += ' pour '+taxon.nom; |
} |
} |
} |
if(utilisateur != '*') { |
stats += ' pour l\'utilisateur '+utilisateur+' '; |
} |
$('#zone-stats').show(); |
} else { |
stats = "Aucune observation pour ces critères ou pour cette zone"; |
} |
$('#zone-stats > h1').text(stats); |
centrerTitreEtStats(); |
} |
function attribuerListenersOverlay() { |
$(window).resize(function() { |
dimensionnerCarte(); |
definirTailleOverlay(); |
centrerTitreEtStats(); |
programmerRafraichissementCarte(); |
google.maps.event.trigger($('#carte'), 'resize'); |
}); |
$('#lien_plein_ecran a').click(function(event) { |
window.open(window.location.href); |
event.preventDefault(); |
}); |
$('#lien-voir-cc a').click(function(event) { |
ouvrirPopUp(this, 'Avertissement', event); |
event.preventDefault(); |
}); |
} |
var tailleMaxFiltreUtilisateur; |
function definirTailleOverlay() { |
var largeurViewPort = $(window).width(), |
taille = '1.6', |
tailleMaxLogo = 60, |
tailleMaxIcones = 10, |
padding_icones = 8, |
tailleFiltre = 80; |
tailleMaxFiltreUtilisateur = 350; |
$('#raz-filtre-utilisateur').css('display', 'block'); |
if (largeurViewPort <= 450) { |
taille = '1'; |
tailleMaxIcones = 10; |
tailleFiltre = 65; |
padding_icones = 2; |
var tailleMaxLogo = 50; |
$('#raz-filtre-utilisateur').css('display', 'inline'); |
} else if (largeurViewPort <= 500) { |
taille = '1.2'; |
tailleMaxIcones = 10; |
tailleFiltre = 65; |
padding_icones = 2; |
var tailleMaxLogo = 50; |
tailleMaxFiltreUtilisateur = 200; |
$('#raz-filtre-utilisateur').css('display', 'inline'); |
} else if (largeurViewPort > 500 && largeurViewPort <= 800) { |
taille = '1.4'; |
tailleMaxIcones = 15; |
padding_icones = 6; |
tailleFiltre = 65; |
var tailleMaxLogo = 55; |
tailleMaxFiltreUtilisateur = 250; |
} else if (largeurViewPort > 800) { |
taille = '1.6'; |
tailleMaxIcones = 20; |
padding_icones = 8; |
tailleFiltre = 80; |
tailleMaxFiltreUtilisateur = 350; |
} |
// Aménagement de la taille de police selon l'écran |
$("#carte-titre").css('font-size', taille+'em'); |
$("#zone-stats h1").css('font-size', Math.round((taille*0.75*100))/100+'em'); |
$("#zone-stats").css('padding', padding_icones+"px "+padding_icones+"px "+Math.round(padding_icones/4)+"px"); |
$('#zone-stats').height(tailleMaxIcones*1.5); |
$("#zone-titre h1").css('font-size', (taille)+'em'); |
$("#zone-titre").css('padding', padding_icones+"px "+padding_icones+"px "+Math.round(padding_icones/4)+"px"); |
$('#zone-titre').height(tailleMaxIcones*2); |
$('.icone').height(tailleMaxIcones); |
$('#lien_plein_ecran').css("padding", padding_icones+"px "+padding_icones+"px "+Math.ceil(padding_icones/2)+"px"); |
$('#lien-voir-cc').css("font-size", taille+"em"); |
$('#lien-voir-cc').css("padding", padding_icones+"px"); |
$("#panneau-lateral").css('font-size', (taille*0.9)+'em'); |
$("#pl-contenu").css('font-size', (taille/2)+'em'); |
$("#panneau-lateral").css('padding', padding_icones+"px "+padding_icones+"px "+Math.round(padding_icones/4)+"px"); |
$('#pl-ouverture').height(((padding_icones*2)+$('#panneau-lateral').height())+"px"); |
$("#panneau-lateral").width(tailleFiltre); |
$('#lien-affichage-filtre-utilisateur').width(tailleFiltre); |
$('#lien-affichage-filtre-utilisateur').height(tailleFiltre*0.35); |
$('#lien-affichage-filtre-utilisateur').css('font-size', (taille*0.9)+'em'); |
$('#conteneur-filtre-utilisateur').css('max-width',tailleMaxFiltreUtilisateur); |
dimensionnerLogo(tailleMaxLogo); |
dimensionnerImage(largeurViewPort); |
redimensionnerControleTypeCarte(largeurViewPort); |
} |
function dimensionnerLogo(tailleMaxLogo) { |
// Dimensionnement du logo |
hauteurLogo = $('.image-logo').height(); |
// Redimensionnement du logo s'il est trop grand |
// on perd en qualité mais ça vaut mieux que de casser l'affichage |
if (hauteurLogo > tailleMaxLogo) { |
hauteurLogo = tailleMaxLogo; |
$('.image-logo').css("top", "5px"); |
$('.image-logo').height(tailleMaxLogo); |
} |
if (hauteurLogo == 0) { |
$('.image-logo').load(function(event) { |
definirTailleOverlay(); |
}); |
return; |
} |
largeurLogo = $('#logo img').width(); |
} |
function dimensionnerImage(largeurViewPort) { |
// Dimensionnement de l'image |
if (largeurViewPort > 500) { |
largeurLogo = 155; |
} else { |
largeurLogo = 70; |
} |
$('#image-utilisateur img').width(largeurLogo); |
} |
function redimensionnerControleTypeCarte(largeurViewPort) { |
if (largeurViewPort <= 500) { |
carteOptions.mapTypeControlOptions.style = google.maps.MapTypeControlStyle.DROPDOWN_MENU; |
} else { |
carteOptions.mapTypeControlOptions.style = google.maps.MapTypeControlStyle.DEFAULT; |
} |
if (map != null) { |
map.setOptions(carteOptions); |
} |
} |
function centrerTitreEtStats() { |
centrerTitre(); |
centrerStats(); |
} |
function centrerTitre() { |
var largeurViewPort = $(window).width(), |
largeurTitre = $('#zone-titre').width(), |
marge = (largeurViewPort - largeurTitre)/2; |
$('#zone-titre').css("margin-left",marge); |
var tailleRestante = largeurViewPort - (marge + largeurTitre); |
if (tailleRestante <= 170) { |
$('#zone-titre').css("top", "25px"); |
} else { |
$('#zone-titre').css("top", "5px"); |
} |
} |
function centrerStats() { |
var largeurViewPort = $(window).width(), |
largeurStats = $('#zone-stats').width(), |
marge = ((largeurViewPort - largeurStats)/2); |
$('#zone-stats').css("margin-left",marge); |
} |
/*+--------------------------------------------------------------------------------------------------------+*/ |
// CARTE |
function dimensionnerCarte() { |
var largeurViewPort = $(window).width(); |
var hauteurViewPort = $(window).height(); |
$('#carte').height(hauteurViewPort); |
$('#carte').width(largeurViewPort); |
} |
function initialiserCarte() { |
map = new google.maps.Map(document.getElementById('carte'), carteOptions); |
// Ajout de la couche OSM à la carte |
map.mapTypes.set('OSM', osmMapType); |
// écouteur sur changement de fond |
google.maps.event.addListener( map, 'maptypeid_changed', function() { |
// licence par défaut |
var mention = 'Observations du réseau <a href="http://www.tela-botanica.org/site:botanique" ' + |
'onClick="ouvrirNouvelleFenetre(this, event)">' + |
'Tela Botanica' + |
'</a> '; |
if (map.getMapTypeId() == 'OSM') { |
// ajout licence OSM |
mention += ' - Carte : <a href="http://www.openstreetmap.org/copyright" target="_blank">© les contributeurs d’OpenStreetMap</a>' + |
' - Tuiles : <a href="http://www.openstreetmap.fr" target="_blank">OsmFr</a>'; |
} |
$('#origine-donnees').html(mention); |
}); |
} |
function initialiserGestionnaireMarqueurs() { |
mgr = new MarkerManager(map); |
} |
function chargerLimitesCommunales() { |
if (urlsLimitesCommunales != null) { |
for (urlId in urlsLimitesCommunales) { |
var url = urlsLimitesCommunales[urlId]; |
ctaLayer = new google.maps.KmlLayer(url, {preserveViewport: true}); |
ctaLayer.setMap(map); |
} |
} |
} |
var listener = null, // pourquoi on le conserve, et on met 3 trucs différents dedans ? |
timer = null; |
function attribuerListenerCarte() { |
listener = google.maps.event.addListener(map, 'bounds_changed', function() { |
programmerRafraichissementCarte(); |
}); |
listener = google.maps.event.addListener(map, 'zoom_changed', function() { |
programmerRafraichissementCarte(); |
}); |
listener = google.maps.event.addListener(map, 'click', function() { |
if (infoBulleOuverte) { |
infoBulle.close(); |
surFermetureInfoBulle(); |
} |
}); |
} |
function programmerRafraichissementCarte() { |
if (timer != null) { |
window.clearTimeout(timer); |
} |
if (requeteChargementPoints != null) { |
requeteChargementPoints.abort(); |
} |
timer = window.setTimeout(function() { |
if (map.getBounds() != undefined) { |
var zoom = map.getZoom(), |
lngNE = map.getBounds().getNorthEast().lng(), |
lngSW = map.getBounds().getSouthWest().lng() |
if (map.getBounds().getNorthEast().lng() < map.getBounds().getSouthWest().lng()) { |
lngNE = 176; |
lngSW = -156; |
} |
var NELatLng = (map.getBounds().getNorthEast().lat())+'|'+(lngNE), |
SWLatLng = (map.getBounds().getSouthWest().lat())+'|'+(lngSW); |
chargerMarqueurs(zoom, NELatLng, SWLatLng); |
} else { |
programmerRafraichissementCarte(); |
} |
}, 400); |
} |
var marqueurs = new Array(); |
function chargerMarqueurs(zoom, NELatLng, SWLatLng) { |
cacherMessageAucuneObs(); |
var url = stationsUrl+ |
'&zoom='+zoom+ |
'&ne='+NELatLng+ |
'&sw='+SWLatLng; |
if (infoBulleOuverte) { |
return; |
} |
if (requeteChargementPoints != null) { |
requeteChargementPoints.abort(); |
cacherMessageChargementPoints(); |
} |
afficherMessageChargementPoints(); |
requeteChargementPoints = $.getJSON(url, function(data) { |
rafraichirMarqueurs(data); |
cacherMessageChargementPoints(); |
}); |
} |
function centrerDansLaPage(selecteur) { |
var largeurViewport = $(window).width(), |
hauteurViewport = $(window).height(); |
selecteur.css('display','block'); |
var left = (largeurViewport/2) - (selecteur.width())/2, |
top = (hauteurViewport/2) - (selecteur.height())/2 |
selecteur.css('left',left); |
selecteur.css('top',top); |
} |
function afficherMessageChargementPoints() { |
//centrerDansLaPage($('#zone-chargement-point')); |
$('#zone-chargement-point').css('display','block'); |
} |
function cacherMessageChargementPoints() { |
$('#zone-chargement-point').css('display','none'); |
} |
function afficherMessageAucuneObs() { |
centrerDansLaPage($('#message-aucune-obs')); |
$('#message-aucune-obs').show(); |
} |
function cacherMessageAucuneObs() { |
centrerDansLaPage($('#message-aucune-obs')); |
$('#message-aucune-obs').hide(); |
} |
premierChargement = true; |
function doitCentrerCarte() { |
return premierChargement && urlVars != null && urlVars.length > 0; |
} |
function rafraichirMarqueurs(data) { |
$.each(marqueurs, function(index, marqueur) { |
marqueur.setMap(null); |
}); |
marqueurs = new Array(); |
stations = null; |
if (data.points.length > 0) { |
marqueurs = new Array(); |
stations = data; |
$.each(stations.points, function (index, station) { |
if(station != null) { |
var nouveauMarqueur = creerMarqueur(station); |
marqueurs.push(nouveauMarqueur); |
} |
}); |
if (doitCentrerCarte()) { |
premierChargement = false; |
var bounds = new google.maps.LatLngBounds(), |
latMax = new google.maps.LatLng(data.stats.coordmax.latMax, data.stats.coordmax.lngMax), |
latMin = new google.maps.LatLng(data.stats.coordmax.latMin, data.stats.coordmax.lngMin); |
bounds.extend(latMax); |
bounds.extend(latMin); |
rendrePointsVisibles(bounds); |
} |
} |
afficherTitreCarteEtStats(); |
} |
function creerMarqueur(station) { |
var titre = ''; |
if (station.nbreMarqueur) { |
titre = station.nbreMarqueur+' points renseignés'; |
} else { |
if(station.nom) { |
titre = station.nom; |
} |
} |
var icone = attribuerImageMarqueur(station['id'], station['nbreMarqueur']), |
latLng = new google.maps.LatLng(station['lat'], station['lng']), |
marqueur = new google.maps.Marker({ |
position: latLng, |
icon: icone, |
title: ''+titre, |
map: map, |
stationInfos: station |
}); |
attribuerListenerClick(marqueur, station['id']); |
marqueur.setMap(map); |
return marqueur; |
} |
function rendrePointsVisibles(bounds) { |
map.setCenter(bounds.getCenter()); |
map.fitBounds(bounds); |
} |
function attribuerImageMarqueur(id, nbreMarqueur) { |
var marqueurImage = null; |
if (etreMarqueurCommune(id)) { |
marqueurImage = new google.maps.MarkerImage(communeImageUrl, new google.maps.Size(24, 32)); |
} else if (etreMarqueurStation(id)) { |
marqueurImage = new google.maps.MarkerImage(pointImageUrl, new google.maps.Size(16, 16)); |
} else if (etreMarqueurGroupe(id)) { |
var type = 0, |
largeur = 0, |
hauteur = 0; |
if (nbreMarqueur != null) { |
if (nbreMarqueur >= 2 && nbreMarqueur < 100 ) { |
type = '1'; |
largeur = 53; |
hauteur = 52; |
} else if (nbreMarqueur >= 100 && nbreMarqueur < 1000 ) { |
type = '2'; |
largeur = 56; |
hauteur = 55; |
} else if (nbreMarqueur >= 1000 && nbreMarqueur < 10000 ) { |
type = '3'; |
largeur = 66; |
hauteur = 65; |
} else if (nbreMarqueur >= 10000 && nbreMarqueur < 20000 ) { |
type = '4'; |
largeur = 78; |
hauteur = 77; |
} else if (nbreMarqueur >= 20000) { |
type = '5'; |
largeur = 66; |
hauteur = 65; |
} |
} |
groupeImageUrl = groupeImageUrlTpl.replace(/\{type\}/, type); |
groupeImageUrl = groupeImageUrl.replace(/\{nbre\}/, nbreMarqueur); |
marqueurImage = new google.maps.MarkerImage(groupeImageUrl, new google.maps.Size(largeur, hauteur)); |
} |
return marqueurImage |
} |
function attribuerListenerClick(marqueur, id) { |
if (etreMarqueurCommune(id) || etreMarqueurStation(id)) { |
google.maps.event.addListener(marqueur, 'click', surClickMarqueur); |
} else if (etreMarqueurGroupe(id)) { |
google.maps.event.addListener(marqueur, 'click', surClickGroupe); |
} |
} |
var pointCentreAvantAffichageInfoBulle = null; |
function surClickMarqueur(event) { |
pointCentreAvantAffichageInfoBulle = map.getCenter(); |
if(infoBulleOuverte) { |
infoBulle.close(); |
} |
pointClique = this; |
infoBulle.open(map, this); |
actualiserPagineur(); |
var limites = map.getBounds(), |
centre = limites.getCenter(), |
nordEst = limites.getNorthEast(), |
centreSudLatLng = new google.maps.LatLng(nordEst.lat(), centre.lng()); |
map.panTo(centreSudLatLng); |
afficherInfoBulle(); |
} |
function surClickGroupe() { |
map.setCenter(this.getPosition()); |
var nouveauZoom = map.getZoom() + 2; |
map.setZoom(nouveauZoom); |
mgr.clearMarkers(); |
} |
function etreMarqueurGroupe(id) { |
var groupe = false, |
motif = /^GROUPE/; |
if (motif.test(id)) { |
groupe = true; |
} |
return groupe; |
} |
function etreMarqueurCommune(id) { |
var commune = false, |
motif = /^COMMUNE:/; |
if (motif.test(id)) { |
commune = true; |
} |
return commune; |
} |
function etreMarqueurStation(id) { |
var station = false, |
motif = /^STATION:/; |
if (motif.test(id)) { |
station = true; |
} |
return station; |
} |
function deplacerCarteSurPointClique() { |
map.panTo(pointClique.position); |
} |
/*+--------------------------------------------------------------------------------------------------------+*/ |
// INFO BULLE |
var infoBulleOuverte = false; |
function initialiserInfoBulle() { |
google.maps.event.addListener(infoBulle, 'domready', initialiserContenuInfoBulle); |
google.maps.event.addListener(infoBulle, 'closeclick', surFermetureInfoBulle); |
google.maps.event.addListener(infoBulle, 'content_changed', definirLargeurInfoBulle); |
attribuerListenerLienSaisie(); |
} |
function attribuerListenerLienSaisie() { |
$('.lien-widget-saisie').live('click', function(event) { |
event.preventDefault(); |
window.open($(this).attr('href'), '_blank'); |
return false; |
}); |
} |
function surFermetureInfoBulle() { |
infoBulleOuverte = false; |
map.panTo(pointCentreAvantAffichageInfoBulle); |
programmerRafraichissementCarte(); |
} |
function centrerInfoBulle() { |
var limites = map.getBounds(), |
centre = limites.getCenter(), |
nordEst = limites.getNorthEast(), |
centreSudLatLng = new google.maps.LatLng(nordEst.lat(), centre.lng()); |
map.panTo(centreSudLatLng); |
} |
function afficherInfoBulle() { |
var obsHtml = $('#tpl-obs').html(), |
largeur = definirLargeurInfoBulle(), |
taillePolice = definirTaillePoliceInfoBulle(); |
obsHtml = obsHtml.replace(/\{largeur\}/, largeur); |
infoBulle.setContent(obsHtml); |
$('#observations').css('font-size', taillePolice + 'em'); |
chargerObs(0, 0); |
infoBulleOuverte = true; |
} |
//TODO utiliser cette fonction lors des remplacements de |
//paramètres url sur changement de filtre |
function parserFiltre(filtre) { |
var nvpair = {}, |
qs = filtre.replace('?', ''), |
pairs = qs.split('&'); |
$.each(pairs, function(i, v){ |
var pair = v.split('='); |
nvpair[pair[0]] = pair[1]; |
}); |
return nvpair; |
} |
function mettreAJourUrlSaisie(obs) { |
if (obs.observations.length > 0) { |
var filtreTableau = parserFiltre(filtreCommun), |
filtresGardes = new Array() |
idObs = obs.observations[0].idObs; |
filtre = ''; |
for (i in filtreTableau) { |
if (filtreTableau[i] != undefined && filtreTableau[i] != '' && decodeURIComponent(filtreTableau[i]) != '*') { |
filtresGardes.push(i + '=' + filtreTableau[i]); |
} |
} |
filtresGardes.push('id-obs=' + idObs); |
if (filtresGardes.length > 0) { |
filtre = '?' + filtresGardes.join('&'); |
} |
var urlAvecFiltre = urlWidgetSaisie + filtre; |
$('.lien-widget-saisie').attr('href', urlAvecFiltre).parents('.conteneur-lien-saisie').show(); |
} |
} |
function definirLargeurInfoBulle() { |
var largeurViewPort = $(window).width(), |
largeurInfoBulle = null; |
if (largeurViewPort < 400) { |
largeurInfoBulle = 300; |
} else if (largeurViewPort < 800) { |
largeurInfoBulle = 400; |
} else if (largeurViewPort >= 800 && largeurViewPort < 1200) { |
largeurInfoBulle = 500; |
} else if (largeurViewPort >= 1200) { |
largeurInfoBulle = 600; |
} |
return largeurInfoBulle; |
} |
function definirTaillePoliceInfoBulle() { |
var largeurViewPort = $(window).width(), |
taillePolice = null; |
if (largeurViewPort < 400) { |
taillePolice = 0.8; |
} else if (largeurViewPort < 800) { |
taillePolice = 1; |
} |
return taillePolice; |
} |
function afficherMessageChargement(element) { |
if ($('#chargement').get() == '') { |
$('#tpl-chargement').tmpl().appendTo(element); |
} |
} |
function afficherMessageChargementTitreInfoBulle() { |
$("#obs-station-titre").text("Chargement des observations"); |
} |
function supprimerMessageChargement() { |
$('#chargement').remove(); |
} |
function chargerObs(depart, total) { |
if (depart == 0 || depart < total) { |
var limite = 300; |
if (depart == 0) { |
viderTableauObs(); |
} |
var urlObs = observationsUrl+'&start={start}&limit='+limite; |
urlObs = urlObs.replace(/\{stationId\}/g, encodeURIComponent(pointClique.stationInfos.id)); |
if (pointClique.stationInfos.type_emplacement == 'communes') { |
urlObs = urlObs.replace(/commune=%2A/g, formaterParametreCommunePourRequete(pointClique.stationInfos.nom)); |
} |
// Ajout de la zone geo |
if (pointClique.stationInfos.zonegeo) { |
urlObs += '&zonegeo=' + pointClique.stationInfos.zonegeo; |
} |
urlObs = urlObs.replace(/\{nt\}/g, nt); |
urlObs = urlObs.replace(/\{start\}/g, depart); |
$.getJSON(urlObs, function(observations){ |
surRetourChargementObs(observations, depart, total); |
chargerObs(depart+limite, observations.total); |
}); |
} |
} |
function formaterParametreCommunePourRequete(nomCommune) { |
var chaineRequete = ""; |
if(nomCommune.indexOf("(", 0) !== false) { |
var infosCommune = nomCommune.split("("); |
var commune = infosCommune[0]; |
chaineRequete = 'commune='+encodeURIComponent($.trim(commune)); |
} else { |
chaineRequete = 'commune='+encodeURIComponent($.trim(nomCommune)); |
} |
return chaineRequete; |
} |
function viderTableauObs() { |
obsStation = new Array(); |
surClicPagePagination(0, null); |
} |
function surRetourChargementObs(observations, depart, total) { |
obsStation = obsStation.concat(observations.observations); |
if (depart == 0) { |
actualiserInfosStation(observations); |
creerTitreInfoBulle(); |
surClicPagePagination(0, null); |
mettreAJourUrlSaisie(observations); |
} |
afficherPagination(); |
actualiserPagineur(); |
selectionnerOnglet("#obs-vue-"+pagineur.format); |
} |
function actualiserInfosStation(infos) { |
pointClique.stationInfos.commune = infos.commune; |
pointClique.stationInfos.obsNbre = infos.total; |
} |
function creerTitreInfoBulle() { |
$('#obs-total').text(station.obsNbre); |
$('#obs-commune').text(station.commune); |
var titre = ''; |
titre += pointClique.stationInfos.obsNbre+' observation'; |
titre += (pointClique.stationInfos.obsNbre > 1) ? 's': '' ; |
titre += ' pour '; |
if (etreMarqueurCommune(pointClique.stationInfos.id)) { |
nomStation = 'la commune : '; |
} else { |
nomStation = 'la station : '; |
} |
titre += pointClique.stationInfos.nom; |
$('#obs-station-titre').text(titre); |
} |
function actualiserPagineur() { |
pagineur.stationId = pointClique.stationInfos.id; |
pagineur.total = pointClique.stationInfos.obsNbre; |
// Si on est en mode photo on reste en mode liste quelque soit le |
// nombre de résultats |
if (pagineur.total > 4 && photos != 1) { |
pagineur.format = 'tableau'; |
} else { |
pagineur.format = 'liste'; |
} |
} |
function afficherPagination(observations) { |
$('.navigation').pagination(pagineur.total, { |
items_per_page:pagineur.limite, |
callback:surClicPagePagination, |
next_text:'Suivant', |
prev_text:'Précédent', |
prev_show_always:false, |
num_edge_entries:1, |
num_display_entries:4, |
load_first_page:true |
}); |
} |
function surClicPagePagination(pageIndex, paginationConteneur) { |
var index = pageIndex * pagineur.limite, |
indexMax = index + pagineur.limite; |
pagineur.depart = index; |
obsPage = new Array(); |
for (index; index < indexMax; index++) { |
obsPage.push(obsStation[index]); |
} |
supprimerMessageChargement(); |
mettreAJourObservations(); |
return false; |
} |
function mettreAJourObservations() { |
$('#obs-'+pagineur.format+'-lignes').empty(); |
$('#obs-vue-'+pagineur.format).css('display', 'block'); |
$('.obs-conteneur').css('counter-reset', 'item '+pagineur.depart); |
$('#tpl-obs-'+pagineur.format).tmpl(obsPage).appendTo('#obs-'+pagineur.format+'-lignes'); |
// Actualisation de Fancybox |
ajouterFormulaireContact('a.contact'); |
if (pagineur.format == 'liste') { |
ajouterGaleriePhoto('a.cel-img'); |
} |
} |
function initialiserContenuInfoBulle() { |
afficherMessageChargement('#observations'); |
cacherContenuOnglets(); |
afficherOnglets(); |
ajouterTableauTriable('#obs-tableau'); |
afficherTextStationId(); |
corrigerLargeurInfoWindow(); |
} |
function cacherContenuOnglets() { |
$('#obs-vue-tableau').css('display', 'none'); |
$('#obs-vue-liste').css('display', 'none'); |
} |
function afficherOnglets() { |
var $tabs = $('#obs').tabs(); |
$('#obs').bind('tabsselect', function(event, ui) { |
if (ui.panel.id == 'obs-vue-tableau') { |
surClicAffichageTableau(); |
} else if (ui.panel.id == 'obs-vue-liste') { |
surClicAffichageListe(); |
} |
}); |
if (pointClique.stationInfos.nbre > 4) { |
$tabs.tabs('select', "#obs-vue-tableau"); |
} else { |
$tabs.tabs('select', "#obs-vue-liste"); |
} |
} |
function selectionnerOnglet(onglet) { |
$(onglet).css('display', 'block'); |
$('#obs').tabs('select', onglet); |
} |
function afficherTextStationId() { |
$('#obs-station-id').text(pointClique.stationInfos.id); |
} |
function corrigerLargeurInfoWindow() { |
$("#info-bulle").width($("#info-bulle").width() - 17); |
} |
function surClicAffichageTableau(event) { |
pagineur.format = 'tableau'; |
mettreAJourObservations(); |
mettreAJourTableauTriable("#obs-tableau"); |
} |
function surClicAffichageListe(event) { |
pagineur.format = 'liste'; |
mettreAJourObservations(); |
ajouterGaleriePhoto("a.cel-img"); |
} |
function ajouterTableauTriable(element) { |
// add parser through the tablesorter addParser method |
$.tablesorter.addParser({ |
// Définition d'un id unique pour ce parsseur |
id: 'date_cel', |
is: function(s) { |
// doit retourner false si le parsseur n'est pas autodétecté |
return /^\s*\d{2}[\/-]\d{2}[\/-]\d{4}\s*$/.test(s); |
}, |
format: function(date) { |
// Transformation date jj/mm/aaaa en aaaa/mm/jj |
date = date.replace(/^\s*(\d{2})[\/-](\d{2})[\/-](\d{4})\s*$/, "$3/$2/$1"); |
// Remplace la date par un nombre de millisecondes pour trier numériquement |
return $.tablesorter.formatFloat(new Date(date).getTime()); |
}, |
// set type, either numeric or text |
type: 'numeric' |
}); |
$(element).tablesorter({ |
headers: { |
1: { |
sorter: 'date_cel' |
} |
} |
}); |
} |
function mettreAJourTableauTriable(element) { |
$(element).trigger('update'); |
} |
function ajouterGaleriePhoto(element) { |
$(element).fancybox({ |
transitionIn: 'elastic', |
transitionOut: 'elastic', |
speedIn: 600, |
speedOut: 200, |
overlayShow: true, |
titleShow: true, |
titlePosition: 'inside', |
titleFormat: function (titre, currentArray, currentIndex, currentOpts) { |
var motif = /urn:lsid:tela-botanica[.]org:cel:img([0-9]+)$/; |
motif.exec(titre); |
var id = RegExp.$1, |
info = $('#cel-info-'+id).clone().html(), |
tpl = |
'<div class="cel-legende">'+ |
'<p class="cel-legende-vei">'+'Image n°' + (currentIndex + 1) + ' sur ' + currentArray.length +'<\/p>'+ |
(titre && titre.length ? '<p>'+info+'<\/p>' : '' )+ |
'<\/div>'; |
return tpl; |
} |
}).live('click', function(e) { |
if (e.stopPropagation) { |
e.stopPropagation(); |
} |
return false; |
}); |
} |
function ajouterFormulaireContact(element) { |
$(element).fancybox({ |
transitionIn:'elastic', |
transitionOut:'elastic', |
speedIn :600, |
speedOut:200, |
scrolling: 'no', |
titleShow: false, |
onStart: function(selectedArray, selectedIndex, selectedOpts) { |
var element = selectedArray[selectedIndex]; |
var motif = / contributeur-([0-9]+)$/; |
motif.exec($(element).attr('class')); |
// si la classe ne contient pas d'id contributeur |
// alors il faut stocker le numéro d'observation |
var id = RegExp.$1; |
if(id == "") { |
$("#fc_type_envoi").attr('value', 'non-inscrit'); |
var motif = / obs-([0-9]+)$/; |
motif.exec($(element).attr('class')); |
var id = RegExp.$1; |
} else { |
$("#fc_type_envoi").attr('value', 'inscrit'); |
} |
$("#fc_destinataire_id").attr('value', id); |
var motif = / obs-([0-9]+)/; |
motif.exec($(element).attr('class')); |
var id = RegExp.$1; |
//console.log('Obs id : '+id); |
chargerInfoObsPourMessage(id); |
}, |
onCleanup: function() { |
//console.log('Avant fermeture fancybox'); |
$("#fc_destinataire_id").attr('value', ''); |
$("#fc_sujet").attr('value', ''); |
$("#fc_message").text(''); |
}, |
onClosed: function(e) { |
//console.log('Fermeture fancybox'); |
if (e.stopPropagation) { |
e.stopPropagation(); |
} |
return false; |
} |
}); |
} |
function chargerInfoObsPourMessage(idObs) { |
var nomSci = jQuery.trim($(".cel-obs-"+idObs+" .nom-sci:eq(0)").text()); |
var date = jQuery.trim($(".cel-obs-"+idObs+" .date:eq(0)").text()); |
var lieu = jQuery.trim($(".cel-obs-"+idObs+" .lieu:eq(0)").text()); |
var sujet = "Observation #"+idObs+" de "+nomSci; |
var message = "\n\n\n\n\n\n\n\n--\nConcerne l'observation de \""+nomSci+'" du "'+date+'" au lieu "'+lieu+'".'; |
$("#fc_sujet").attr('value', sujet); |
$("#fc_message").text(message); |
} |
function initialiserFormulaireContact() { |
//console.log('Initialisation du form contact'); |
$("#form-contact").validate({ |
rules: { |
fc_sujet : "required", |
fc_message : "required", |
fc_utilisateur_courriel : { |
required : true, |
email : true} |
} |
}); |
$("#form-contact").bind("submit", envoyerCourriel); |
$("#fc_annuler").bind("click", function() {$.fancybox.close();}); |
} |
function envoyerCourriel() { |
//console.log('Formulaire soumis'); |
if ($("#form-contact").valid()) { |
//console.log('Formulaire valide'); |
//$.fancybox.showActivity(); |
var destinataireId = $("#fc_destinataire_id").attr('value'); |
var typeEnvoi = $("#fc_type_envoi").attr('value'); |
if(typeEnvoi == "non-inscrit") { |
// l'envoi au non inscrits passe par le service intermédiaire du cel |
// qui va récupérer le courriel associé à l'obs indiquée |
var urlMessage = "http://www.tela-botanica.org/service:cel:celMessage/obs/"+destinataireId; |
} else { |
var urlMessage = "http://www.tela-botanica.org/service:annuaire:Utilisateur/"+destinataireId+"/message"; |
} |
var erreurMsg = ""; |
var donnees = new Array(); |
$.each($(this).serializeArray(), function (index, champ) { |
var cle = champ.name; |
cle = cle.replace(/^fc_/, ''); |
if (cle == 'sujet') { |
champ.value += " - Carnet en ligne - Tela Botanica"; |
} |
if (cle == 'message') { |
champ.value += "\n--\n"+ |
"Ce message vous est envoyé par l'intermédiaire du widget carto "+ |
"du Carnet en Ligne du réseau Tela Botanica.\n"+ |
"http://www.tela-botanica.org/widget:cel:carto"; |
} |
donnees[index] = {'name':cle,'value':champ.value}; |
}); |
$.ajax({ |
type : "POST", |
cache : false, |
url : urlMessage, |
data : donnees, |
beforeSend : function() { |
$(".msg").remove(); |
}, |
success : function(data) { |
$("#fc-zone-dialogue").append('<pre class="msg info">'+data.message+'</pre>'); |
}, |
error : function(jqXHR, textStatus, errorThrown) { |
erreurMsg += "Erreur Ajax :\ntype : "+textStatus+' '+errorThrown+"\n"; |
reponse = jQuery.parseJSON(jqXHR.responseText); |
if (reponse != null) { |
$.each(reponse, function (cle, valeur) { |
erreurMsg += valeur + "\n"; |
}); |
} |
}, |
complete : function(jqXHR, textStatus) { |
var debugMsg = ''; |
if (jqXHR.getResponseHeader("X-DebugJrest-Data") != '') { |
debugInfos = jQuery.parseJSON(jqXHR.getResponseHeader("X-DebugJrest-Data")); |
if (debugInfos != null) { |
$.each(debugInfos, function (cle, valeur) { |
debugMsg += valeur + "\n"; |
}); |
} |
} |
if (erreurMsg != '') { |
$("#fc-zone-dialogue").append('<p class="msg">'+ |
'Une erreur est survenue lors de la transmission de votre message.'+'<br />'+ |
'Vous pouvez signaler le disfonctionnement à <a href="'+ |
'mailto:cel@tela-botanica.org'+'?'+ |
'subject=Disfonctionnement du widget carto'+ |
"&body="+erreurMsg+"\nDébogage :\n"+debugMsg+ |
'">cel@tela-botanica.org</a>.'+ |
'</p>'); |
} |
if (DEBUG) { |
console.log('Débogage : '+debugMsg); |
} |
//console.log('Débogage : '+debugMsg); |
//console.log('Erreur : '+erreurMsg); |
} |
}); |
} |
return false; |
} |
/*+--------------------------------------------------------------------------------------------------------+*/ |
// PANNEAU LATÉRAL |
var nbTaxons = 0; |
function initialiserAffichagePanneauLateral() { |
if (nt == '*') { |
$('#pl-ouverture').bind('click', afficherPanneauLateral); |
$('#pl-fermeture').bind('click', cacherPanneauLateral); |
} else { |
$('#panneau-lateral').width(0); |
$('#carte').width('100%'); |
} |
attribuerListenersFiltreUtilisateur(); |
chargerTaxons(0, 0); |
} |
function attribuerListenersFiltreUtilisateur() { |
$('#valider-filtre-utilisateur').click(function() { |
var utilisateur = $('#filtre-utilisateur').val(); |
filtrerParUtilisateur(utilisateur); |
$('#raz-filtre-utilisateur').show(); |
}); |
$('#filtre-utilisateur').keypress(function(e) { |
if (e.which == 13) { |
var utilisateur = $('#filtre-utilisateur').val(); |
filtrerParUtilisateur(utilisateur); |
$('#raz-filtre-utilisateur').show(); |
} |
}); |
$('#raz-filtre-utilisateur').click(function() { |
$('#filtre-utilisateur').val(''); |
filtrerParUtilisateur('*'); |
afficherCacherFiltreUtilisateur(); |
$('#raz-filtre-utilisateur').hide(); |
}); |
$('#lien-affichage-filtre-utilisateur').click(function() { |
afficherCacherFiltreUtilisateur(); |
}); |
$('#raz-filtre-utilisateur').hide(); |
$('#formulaire-filtre-utilisateur').hide(); |
} |
function afficherCacherFiltreUtilisateur() { |
$('#formulaire-filtre-utilisateur').slideToggle(); |
$('#conteneur-filtre-utilisateur').toggleClass('ferme'); |
if (!$('#conteneur-filtre-utilisateur').hasClass('ferme')) { |
$('#conteneur-filtre-utilisateur').width(tailleMaxFiltreUtilisateur); |
} else { |
$('#conteneur-filtre-utilisateur').width('auto'); |
} |
} |
function filtrerParUtilisateur(utilisateurFiltre) { |
if (utilisateurFiltre == '') { |
utilisateurFiltre = '*'; |
} |
utilisateur = utilisateurFiltre; |
var pattern = /utilisateur=[^&]*/i, |
utilisateurCourant = pattern.exec(stationsUrl); |
stationsUrl = stationsUrl.replace(utilisateurCourant, "utilisateur="+utilisateurFiltre); |
taxonsUrl = taxonsUrl.replace(utilisateurCourant, "utilisateur="+utilisateurFiltre); |
observationsUrl = observationsUrl.replace(utilisateurCourant, "utilisateur="+utilisateurFiltre); |
filtreCommun = filtreCommun.replace(utilisateurCourant, "utilisateur="+utilisateurFiltre); |
$("#taxons").html(''); |
chargerTaxons(0,0); |
programmerRafraichissementCarte(); |
} |
function chargerTaxons(depart, total) { |
if (depart == 0 || depart < total) { |
if(depart == 0) { |
nbTaxons = 0; |
taxonsCarte = new Array(); |
} |
var limite = 2000; |
//console.log("Chargement des taxons de "+depart+" à "+(depart+limite)); |
var urlTax = taxonsUrl+'&start={start}&limit='+limite; |
urlTax = urlTax.replace(/\{start\}/g, depart); |
//console.log(urlTax); |
$.getJSON(urlTax, function(infos) { |
nbTaxons += infos.taxons.length; |
$('.plantes-nbre').text(nbTaxons); |
$('#tpl-taxons-liste').tmpl({'taxons': infos.taxons}).appendTo('#taxons'); |
taxonsCarte = taxonsCarte.concat(infos.taxons); |
//console.log("Nbre taxons :"+taxonsCarte.length); |
chargerTaxons(depart+limite, infos.total); |
}); |
} else { |
if (nt == '*') { |
afficherTaxons(); |
} |
afficherTitreCarteEtStats(); |
} |
} |
function afficherTaxons() { |
$('.taxon').live('click', filtrerParTaxon); |
$('.raz-filtre-taxons').live('click', viderFiltreTaxon); |
} |
var largeurPanneauLateralFerme = null; |
function afficherPanneauLateral() { |
// fixer la hauteur |
$('#panneau-lateral').height($(window).height() - $('#panneau-lateral').offset().top - 30); |
largeurPanneauLateralFerme = $('#panneau-lateral').width(); |
$('#panneau-lateral').width(300); |
$('#pl-contenu').css('display', 'block'); |
$('#pl-ouverture').css('display', 'none'); |
$('#pl-fermeture').css('display', 'block'); |
// correction pour la taille de la liste des taxons |
$('#pl-corps').height($(window).height() - $('#pl-corps').offset().top); |
google.maps.event.trigger(map, 'resize'); |
}; |
function cacherPanneauLateral() { |
$('#panneau-lateral').height(25 + 'px'); |
$('#panneau-lateral').width(largeurPanneauLateralFerme + 'px'); |
$('#pl-contenu').css('display', 'none'); |
$('#pl-ouverture').css('display', 'block'); |
$('#pl-fermeture').css('display', 'none'); |
google.maps.event.trigger(map, 'resize'); |
}; |
function viderFiltreTaxon() { |
$('.taxon-actif .taxon').click(); |
} |
function filtrerParTaxon() { |
var ntAFiltrer = $('.nt', this).text(); |
infoBulle.close(); |
var zoom = map.getZoom(); |
var NELatLng = map.getBounds().getNorthEast().lat()+'|'+map.getBounds().getNorthEast().lng(); |
var SWLatLng = map.getBounds().getSouthWest().lat()+'|'+map.getBounds().getSouthWest().lng(); |
$('.raz-filtre-taxons').removeClass('taxon-actif'); |
$('#taxon-'+nt).removeClass('taxon-actif'); |
if (nt == ntAFiltrer) { |
nt = '*'; |
stationsUrl = stationsUrl.replace(/num_taxon=[*0-9]+/, 'num_taxon='+nt); |
chargerMarqueurs(zoom, NELatLng, SWLatLng); |
} else { |
stationsUrl = stationsUrl.replace(/num_taxon=[*0-9]+/, 'num_taxon='+ntAFiltrer); |
url = stationsUrl; |
url += '&zoom='+zoom+ |
'&ne='+NELatLng+ |
'&sw='+SWLatLng; |
requeteChargementPoints = $.getJSON(url, function (stationsFiltrees) { |
stations = stationsFiltrees; |
nt = ntAFiltrer; |
$('#taxon-'+nt).addClass('taxon-actif'); |
rafraichirMarqueurs(stations); |
}); |
} |
}; |
/*+--------------------------------------------------------------------------------------------------------+*/ |
// FONCTIONS UTILITAIRES |
function ouvrirPopUp(element, nomPopUp, event) { |
var options = |
'width=650,'+ |
'height=600,'+ |
'scrollbars=yes,'+ |
'directories=no,'+ |
'location=no,'+ |
'menubar=no,'+ |
'status=no,'+ |
'toolbar=no'; |
var popUp = window.open(element.href, nomPopUp, options); |
if (window.focus) { |
popUp.focus(); |
} |
return arreter(event); |
}; |
function ouvrirNouvelleFenetre(element, event) { |
window.open(element.href); |
return arreter(event); |
} |
function arreter(event) { |
if (event.stopPropagation) { |
event.stopPropagation(); |
} else if (window.event) { |
window.event.cancelBubble = true; |
} |
if (event.preventDefault) { |
event.preventDefault(); |
} |
event.returnValue = false; |
return false; |
} |
/** |
* +-------------------------------------+ |
* Number.prototype.formaterNombre |
* +-------------------------------------+ |
* Params (facultatifs): |
* - Int decimales: nombre de decimales (exemple: 2) |
* - String signe: le signe precedent les decimales (exemple: "," ou ".") |
* - String separateurMilliers: comme son nom l'indique |
* Returns: |
* - String chaine formatee |
* @author ::mastahbenus:: |
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org> : ajout détection auto entier/flotant |
* @souce http://www.javascriptfr.com/codes/FORMATER-NOMBRE-FACON-NUMBER-FORMAT-PHP_40060.aspx |
*/ |
Number.prototype.formaterNombre = function (decimales, signe, separateurMilliers) { |
var _sNombre = String(this), i, _sRetour = "", _sDecimales = ""; |
function is_int(nbre) { |
nbre = nbre.replace(',', '.'); |
return !(parseFloat(nbre)-parseInt(nbre) > 0); |
} |
if (decimales == undefined) { |
if (is_int(_sNombre)) { |
decimales = 0; |
} else { |
decimales = 2; |
} |
} |
if (signe == undefined) { |
if (is_int(_sNombre)) { |
signe = ''; |
} else { |
signe = '.'; |
} |
} |
if (separateurMilliers == undefined) { |
separateurMilliers = ' '; |
} |
function separeMilliers (sNombre) { |
var sRetour = ""; |
while (sNombre.length % 3 != 0) { |
sNombre = "0"+sNombre; |
} |
for (i = 0; i < sNombre.length; i += 3) { |
if (i == sNombre.length-1) separateurMilliers = ''; |
sRetour += sNombre.substr(i, 3) + separateurMilliers; |
} |
while (sRetour.substr(0, 1) == "0") { |
sRetour = sRetour.substr(1); |
} |
return sRetour.substr(0, sRetour.lastIndexOf(separateurMilliers)); |
} |
if (_sNombre.indexOf('.') == -1) { |
for (i = 0; i < decimales; i++) { |
_sDecimales += '0'; |
} |
_sRetour = separeMilliers(_sNombre) + signe + _sDecimales; |
} else { |
var sDecimalesTmp = (_sNombre.substr(_sNombre.indexOf('.')+1)); |
if (sDecimalesTmp.length > decimales) { |
var nDecimalesManquantes = sDecimalesTmp.length - decimales; |
var nDiv = 1; |
for (i = 0; i < nDecimalesManquantes; i++) { |
nDiv *= 10; |
} |
_sDecimales = Math.round(Number(sDecimalesTmp) / nDiv); |
} |
_sRetour = separeMilliers(_sNombre.substr(0, _sNombre.indexOf('.')))+String(signe)+_sDecimales; |
} |
return _sRetour; |
} |
function debug(objet) { |
var msg = ''; |
if (objet != null) { |
$.each(objet, function (cle, valeur) { |
msg += cle+':'+valeur + "\n"; |
}); |
} else { |
msg = 'La variable vaut null.'; |
} |
console.log(msg); |
} |
/branches/v2.9-motobineuse/widget/modules/cartopoint/squelettes/css/carto.css |
---|
New file |
0,0 → 1,718 |
@charset "UTF-8"; |
html { |
overflow:hidden; |
} |
body { |
overflow:hidden; |
padding:0; |
margin:0; |
width:100%; |
height:100%; |
font-family:Arial; |
font-size:12px; |
} |
h1 { |
font-size:1.6em; |
} |
h2 { |
font-size:1.4em; |
} |
a, a:active, a:visited { |
border-bottom:1px dotted #666; |
color:#CCC; |
text-decoration:none; |
} |
a:active { |
outline:none; |
} |
a:focus { |
outline:thin dotted; |
} |
a:hover { |
color:#56B80E; |
border-bottom:1px dotted #56B80E; |
} |
img { |
border:none; |
} |
/*+-----------------------------------------------------------------------------------------------------------------+*/ |
/* Présentation des listes de définitions */ |
dl { |
width:100%; |
margin:0; |
} |
dt { |
float:left; |
font-weight:bold; |
text-align:top left; |
margin-right:0.3em; |
line-height:0.8em; |
} |
dd { |
width:auto; |
margin:0.5em 0; |
line-height:0.8em; |
} |
/*+-----------------------------------------------------------------------------------------------------------------+*/ |
/* Tableau : */ |
table { |
border:1px solid gray; |
border-collapse:collapse; |
width:100%; |
} |
table thead, table tfoot, table tbody { |
background-color:Gainsboro; |
border:1px solid gray; |
} |
table tbody { |
background-color:#FFF; |
} |
table th { |
font-family:monospace; |
border:1px dotted gray; |
padding:5px; |
background-color:Gainsboro; |
} |
table td { |
font-family:arial; |
border:1px dotted gray; |
padding:5px; |
text-align:left; |
} |
table caption { |
font-family:sans-serif; |
} |
/*+-----------------------------------------------------------------------------------------------------------------+*/ |
/* Tableau : tablesorter */ |
th.header { |
background:url(../images/trie.png) no-repeat center right; |
padding-right:20px; |
} |
th.headerSortUp { |
background:url(../images/trie_croissant.png) no-repeat center right #56B80E; |
color:white; |
} |
th.headerSortDown { |
background:url(../images/trie_decroissant.png) no-repeat center right #56B80E; |
color:white; |
} |
/*+-----------------------------------------------------------------------------------------------------------------+*/ |
/* Générique */ |
.nettoyage{ |
clear:both; |
} |
hr.nettoyage{ |
visibility:hidden; |
} |
.element-overlay { |
background-color: #DDDDDD; |
border:1px solid grey; |
} |
/*+-----------------------------------------------------------------------------------------------------------------+*/ |
/* Carte */ |
#carte { |
padding:0; |
margin:0; |
position:absolute; |
right:0; |
bottom:0; |
overflow:auto; |
width: 100%; |
height: 100%; |
} |
.carte_titree { |
top:35px; |
} |
.carte_non_titre { |
top:0px; |
} |
.bouton { |
background-color:white; |
border:2px solid black; |
cursor:pointer; |
text-align:center; |
} |
/*+-----------------------------------------------------------------------------------------------------------------+*/ |
/* Message de chargement */ |
#zone-chargement-point { |
display: none; |
position: fixed; |
left: 110px; |
top: 10px; |
z-index: 3000; |
width: 180px; |
height: 42px; |
padding: 7px; |
text-align: center; |
background-color: rgba(255, 255, 255, 0.85); |
border: solid #dedede 1px; |
border-radius: 4px; |
} |
#legende-chargement { |
padding-top: 7px; |
} |
#img-chargement { |
float: left; |
margin-right: 5px; |
} |
#chargement { |
margin:25px; |
text-align:center; |
} |
#chargement img{ |
display:block; |
margin:auto; |
} |
#message-aucune-obs p { |
padding-top : 25px; |
font-weight: bold; |
} |
#message-aucune-obs { |
background-image: url("../images/attention.png"); |
background-position: 50% 10px; |
background-repeat: no-repeat; |
display: none; |
height: 70px; |
padding: 10px; |
position: fixed; |
text-align: center; |
width: 230px; |
z-index: 3000; |
} |
/*+-----------------------------------------------------------------------------------------------------------------+*/ |
/* Avertissement */ |
#zone-avertissement { |
background-color:#DDDDDD; |
color: black; |
padding:12px; |
text-align:justify; |
line-height:16px; |
} |
#zone-avertissement h1{ |
margin:0; |
} |
#zone-avertissement a { |
border-bottom:1px dotted gainsboro; |
} |
#zone-avertissement a, a:active, a:visited { |
color: #666666; |
} |
/*+-----------------------------------------------------------------------------------------------------------------+*/ |
/* Carte titre */ |
#zone-titre { |
top: 30px; |
} |
#zone-titre, #zone_stats { |
padding:0; |
position:absolute; |
height:25px; |
overflow:hidden; |
border-radius: 4px; |
z-index: 3000; |
display: inline-block; |
padding:8px; |
color: black; |
font-family: inherit; |
font-size: 1.1em; |
font-weight: bold; |
text-rendering: optimizelegibility; |
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05) inset; |
} |
#zone-info { |
position:absolute; |
top:26px; |
z-index:3001; |
right:8px; |
width: 25px; |
text-align:right; |
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05) inset; |
border-radius: 5px 5px 5px 5px; |
} |
#zone-info a { |
border: none; |
} |
#logo { |
left: 2px; |
padding: 4px; |
position: absolute; |
top: 5px; |
z-index: 3002; |
width: 60px; |
} |
.image-logo { |
padding: 5px; |
background-color: rgba(255, 255, 255, 0.9); |
border: solid #dedede 1px; |
border-radius: 4px; |
} |
#logo a { |
border-bottom: none; |
} |
#carte-titre { |
display:inline-block; |
margin:0; |
padding:0em; |
} |
#carte-titre {/*Hack CSS fonctionne seulement dans ie6, 7 & 8 */ |
display:inline !hackCssIe6Et7;/*Hack CSS pour ie6 & ie7 */ |
display /*\**/:inline\9;/*Hack CSS pour ie8 */ |
} |
#image-utilisateur { |
position: absolute; |
right: 5px; |
top: 40%; |
} |
#lien-affichage-filtre-utilisateur { |
right: 5px; |
float: right; |
padding-bottom: 1px; |
cursor: pointer; |
font-weight: bold; |
margin-left: 25px; |
padding: 3px; |
position: relative; |
top: 3px; |
width: 117px; |
height: 30px; |
} |
#conteneur-filtre-utilisateur.ferme:hover { |
color: #222222; |
background-color: #AAAAAA; |
text-decoration: none; |
cursor: pointer; |
border: 1px solid #222222; |
} |
#conteneur-filtre-utilisateur { |
float: right; |
padding: 3px; |
position: absolute; |
right: 5px; |
top: 31px; |
border-radius: 5px 5px 5px 5px; |
width: 117px; |
max-width: 350px; |
} |
.largeurAuto { |
width: auto; |
} |
#raz-filtre-utilisateur { |
color: red; |
padding-left: 1px; |
word-wrap: break-word; |
width: 110px; |
} |
/*+-----------------------------------------------------------------------------------------------------------------+*/ |
/* Panneau latéral */ |
#panneau-lateral { |
padding:0; |
margin:0; |
position:absolute; |
top: 90px; |
left:0; |
bottom:0; |
width: 83px; |
overflow:hidden; |
height: 25px; |
z-index: 3001; |
border-top-right-radius : 10px; |
border-bottom-right-radius : 10px; |
} |
#pl-indication-filtre { |
margin-left : 25px; |
padding : 3px; |
font-weight: bold; |
padding: 3px; |
position: relative; |
top: 3px; |
} |
#pl-contenu { |
display:none; |
} |
#pl-entete { |
height:95px; |
} |
#pl-corps { |
bottom:0; |
overflow:auto; |
padding:5px; |
width:290px; |
} |
#pl-ouverture, #pl-fermeture { |
position:absolute; |
top:0; |
height:60px; |
width:24px; |
text-align:center; |
cursor:pointer; |
} |
#pl-ouverture { |
left:0; |
background:url(../images/ouverture.png) no-repeat top left #4A4B4C; |
height:100%; |
} |
#pl-fermeture { |
display:none; |
right: 0; |
background:url(../images/fermeture.png) no-repeat top right #4A4B4C; |
} |
#pl-ouverture span, #pl-fermeture span{ |
display:none; |
} |
/* Panneau latéral : balises */ |
#panneau-lateral h2, #panneau-lateral p { |
color:black;} |
/*+-----------------------------------------------------------------------------------------------------------------+*/ |
/* Liste des taxons de la carte */ |
#taxons { |
color:black; |
} |
#taxons .taxon-actif, #taxons .taxon-actif span, .raz-filtre-taxons.taxon-actif { |
color:#56B80E; |
} |
#taxons li span, .raz-filtre-taxons { |
border-bottom:1px dotted #666; |
color:black; |
} |
#taxons li span:focus { |
outline:thin dotted; |
} |
#taxons li span:hover { |
color:#56B80E; |
border-bottom:1px dotted #56B80E; |
cursor:pointer; |
} |
.nt { |
display:none; |
} |
.raz-filtre-taxons { |
cursor:pointer; |
} |
/*+-----------------------------------------------------------------------------------------------------------------+*/ |
/* Zone des stats en bas */ |
#zone-stats { |
padding:0; |
position:absolute; |
height:25px; |
bottom:20px; |
overflow:hidden; |
border-radius: 4px; |
z-index: 3000; |
display: inline-block; |
padding:8px; |
color: black; |
font-family: inherit; |
font-size: 1.1em; |
font-weight: bold; |
text-rendering: optimizelegibility; |
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05) inset; |
} |
#zone-stats h1 { |
margin-top: 0; |
} |
#lien_plein_ecran, #lien-voir-cc { |
position: absolute; |
z-index: 3000; |
border-radius: 4px; |
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05) inset; |
padding: 8px 8px 4px; |
font-size: 1.1em; |
font-weight: bold; |
} |
#lien_plein_ecran { |
bottom: 20px; |
left: 5px; |
} |
#lien_plein_ecran a, #lien-voir-cc a { |
color: black; |
padding: 2px; |
border-bottom: none; |
} |
#lien_plein_ecran img { |
height: 20px; |
} |
#lien-voir-cc { |
bottom: 3px; |
right: 5px; |
bottom: 20px; |
height: 20px; |
} |
#origine-donnees { |
-moz-user-select: none; |
background: -moz-linear-gradient(center , rgba(255, 255, 255, 0) 0pt, rgba(255, 255, 255, 0.5) 50px) repeat scroll 0 0 transparent; |
color: #444444; |
direction: ltr; |
font-family: Arial,sans-serif; |
font-size: 10px; |
font-weight: bold; |
height: 19px; |
line-height: 19px; |
padding-left: 50px; |
padding-right: 2px; |
bottom: 0px; |
position: absolute; |
text-align: right; |
white-space: nowrap; |
z-index: 3001; |
} |
#origine-donnees a { |
color: #444444; |
cursor: pointer; |
text-decoration: underline; |
border-bottom: none; |
} |
#origine-donnees a:active, #origine-donnees a:visited { |
border-bottom: 1px dotted #666666; |
color: #CCCCCC; |
text-decoration: none; |
} |
#origine-donnees a:visited { |
border-bottom: 1px dotted #666666; |
color: #444444; |
text-decoration: none; |
} |
/*+-----------------------------------------------------------------------------------------------------------------+*/ |
/* Pop-up observations */ |
#info-bulle{ |
min-height:500px; |
width:500px; |
} |
#observations { |
overflow:none; |
margin:-1px 0 0 0; |
border: 1px solid #AAA; |
border-radius:0 0 4px 4px; |
} |
#obs-pieds-page { |
font-size:10px; |
color:#CCC; |
clear:both; |
} |
.ui-tabs { |
padding:0; |
} |
.ui-widget-content { |
border:0; |
} |
.ui-widget-header { |
background:none; |
border:0; |
border-bottom:1px solid #AAA; |
border-radius:0; |
} |
.ui-tabs-selected a { |
border-bottom:1px solid white; |
} |
.ui-tabs-selected a:focus { |
outline:0; |
} |
.ui-tabs .ui-tabs-panel { |
padding:0.2em; |
} |
.ui-tabs .ui-tabs-nav li a { |
padding: 0.5em 0.6em; |
} |
#obs h2 { |
margin:0; |
text-align:center; |
} |
#observations a { |
color:#333; |
border-bottom:1px dotted gainsboro; |
} |
#observations a:hover { |
color:#56B80E; |
border-bottom:1px dotted #56B80E; |
} |
.nom-sci{ |
color:#454341; |
font-weight:bold; |
} |
/*+-----------------------------------------------------------------------------------------------------------------+*/ |
/* Pop-up observations : liste */ |
.cel-img-principale { |
height:0;/*Pour IE*/ |
} |
.cel-img-principale img{ |
float:right; |
height:75px; |
width:75px; |
padding:1px; |
border:1px solid white; |
} |
#observations .cel-img:hover img{ |
border: 1px dotted #56B80E; |
} |
.cel-img-secondaire, .cel-infos{ |
display: none; |
} |
ol#obs-liste-lignes { |
padding:5px; |
margin:0; |
} |
.champ-nom-sci { |
display:none; |
} |
#obs-liste-lignes li dl {/*Pour IE*/ |
width:350px; |
} |
.obs-conteneur{ |
counter-reset: item; |
} |
.obs-conteneur .nom-sci:before { |
content: counter(item) ". "; |
counter-increment: item; |
display:block; |
float:left; |
} |
.obs-conteneur li { |
display: block; |
margin-bottom:1em; |
} |
.lien-widget-saisie { |
background: url("../images/saisie.png") no-repeat scroll left center transparent; |
border: 1px solid #AAAAAA; |
background-color: #EEE; |
padding: 5px 5px 5px 25px; |
text-decoration: none; |
border-radius : 5px; |
} |
.lien-widget-saisie:hover { |
color: #222222; |
background-color: #AAAAAA; |
text-decoration: none; |
cursor: pointer; |
border: 1px solid #222222; |
} |
/*+-----------------------------------------------------------------------------------------------------------------+*/ |
/* Diaporama */ |
.cel-legende{ |
text-align:left; |
} |
.cel-legende-vei{ |
float:right; |
} |
.cel-legende p{ |
color: black; |
font-size: 12px; |
line-height: 18px; |
margin: 0; |
} |
.cel-legende a, .cel-legende a:active, .cel-legende a:visited { |
border-bottom:1px dotted gainsboro; |
color:#333; |
text-decoration:none; |
background-image:none; |
} |
.cel-legende a:hover { |
color:#56B80E; |
border-bottom:1px dotted #56B80E; |
} |
/*+-----------------------------------------------------------------------------------------------------------------+*/ |
/* Plugin Jquery Pagination */ |
.navigation { |
padding:5px; |
float:right; |
} |
.pagination { |
font-size: 80%; |
} |
.pagination a { |
text-decoration: none; |
border: solid 1px #666; |
color: #666; |
background:gainsboro; |
} |
.pagination a:hover { |
color: white; |
background: #56B80E; |
} |
.pagination a, .pagination span { |
display: block; |
float: left; |
padding: 0.3em 0.5em; |
margin-right: 5px; |
margin-bottom: 5px; |
min-width:1em; |
text-align:center; |
} |
.pagination .current { |
background: #4A4B4C; |
color: white; |
border: solid 1px gainsboro; |
} |
.pagination .current.prev, .pagination .current.next{ |
color: #999; |
border-color: #999; |
background: gainsboro; |
} |
/*+-----------------------------------------------------------------------------------------------------------------+*/ |
/* Formulaire de contact */ |
#form-contact input{ |
width:300px; |
} |
#form-contact textarea{ |
width:300px; |
height:200px; |
} |
#form-contact #fc_envoyer{ |
width:50px; |
float:right; |
} |
#form-contact #fc_annuler{ |
width:50px; |
float:left; |
} |
#form-contact label.error { |
color:red; |
font-weight:bold; |
} |
#form-contact .info { |
padding:5px; |
background-color: #4A4B4C; |
border: solid 1px #666; |
color: white; |
white-space: pre-wrap; |
width: 300px; |
} |
/* hack Fancybox pour que le popup soit toujours au dessus */ |
#fancybox-wrap { |
z-index: 3100; |
} |
/branches/v2.9-motobineuse/widget/modules/cartopoint/squelettes/avertissement.tpl.html |
---|
New file |
0,0 → 1,39 |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
<html> |
<head> |
<title>Avertissements - CEL widget cartographie</title> |
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/> |
<meta http-equiv="Content-style-type" content="text/css" /> |
<meta http-equiv="Content-script-type" content="text/javascript" /> |
<meta http-equiv="Content-language" content="fr" /> |
<meta name="revisit-after" content="15 days" /> |
<meta name="robots" content="index,follow" /> |
<meta name="author" content="Delphine CAUQUIL, Jean-Pascal MILCENT" /> |
<meta name="keywords" content="Avertissement, Tela Botanica, cartographie, CEL" /> |
<meta name="description" content="Avertissement du widget de cartographie des observations publiques de plantes saisies dans le Carnet en Ligne (CEL)" /> |
<!-- Spécial mobile --> |
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> |
<!-- Favicones --> |
<link rel="icon" type="image/png" href="http://www.tela-botanica.org/sites/commun/generique/images/favicones/tela_botanica.png" /> |
<link rel="shortcut icon" type="image/x-icon" href="http://www.tela-botanica.org/sites/commun/generique/images/favicones/tela_botanica.ico" /> |
<!-- CSS --> |
<link href="<?=$url_base?>modules/cartopoint/squelettes/css/carto.css" rel="stylesheet" type="text/css" media="screen" /> |
<style> |
html { |
overflow:auto; |
} |
body { |
overflow:auto; |
} |
</style> |
</head> |
<body> |
<div id="zone-avertissement"> |
<?= $contenu_aide; ?> |
</div> |
</body> |
</html> |
/branches/v2.9-motobineuse/widget/modules/cartopoint/. |
---|
New file |
Property changes: |
Added: svn:ignore |
+config.ini |