156,31 → 156,35 |
function attribuerListenersOverlay() { |
|
$(window).resize(function() { |
programmerRafraichissementCarte(); |
google.maps.event.trigger($('#carte'), 'resize'); |
definirTailleOverlay(); |
centrerTitreEtStats(); |
google.maps.event.trigger($('#carte'), 'resize'); |
programmerRafraichissementCarte(); |
}); |
|
$('#lien_plein_ecran a').click(function(event) { |
window.open(window.location.href); |
event.preventDefault(); |
}); |
|
$('#lien_voir_cc a').click(function(event) { |
window.open($(this).attr('href')); |
event.preventDefault(); |
}); |
} |
|
function definirTailleOverlay() { |
var largeurViewPort = $(window).width(); |
var taille = null; |
var taille = '1.6'; |
var tailleMaxLogo = 50; |
var tailleMaxIcones = 20; |
var padding_icones = 8; |
var tailleFiltre = 80; |
if (largeurViewPort <= 500) { |
taille = '0.8'; |
tailleMaxLogo = 20; |
tailleMaxIcones = 10; |
tailleFiltre = 60; |
padding_icones = 2; |
|
} else if (largeurViewPort > 500 && largeurViewPort <= 800) { |
188,11 → 192,13 |
tailleMaxLogo = 40; |
tailleMaxIcones = 15; |
padding_icones = 6; |
tailleFiltre = 60; |
} else if (largeurViewPort > 800) { |
taille = '1.6'; |
tailleMaxLogo = 50; |
tailleMaxIcones = 20; |
padding_icones = 8; |
tailleFiltre = 80; |
} |
|
// Aménagement de la taille de police selon l'écran |
207,6 → 213,10 |
|
$('#zone-stats').height(tailleMaxIcones*1.5); |
|
$("#panneau-lateral").css('font-size', (taille*0.80)+'em'); |
$("#panneau-lateral").css('padding', padding_icones+"px "+padding_icones+"px "+Math.round(padding_icones/4)+"px"); |
$("#panneau-lateral").width(tailleFiltre); |
|
// Dimensionnement du titre et du logo |
if(urlLogo != "null") { |
hauteurLogo = $('#logo img').height(); |
227,7 → 237,7 |
largeurLogo = $('#logo img').width(); |
largeurTitre = $('#carte-titre-infos').width(); |
|
$('#zone-titre').css("height", (hauteurLogo)+"px"); |
$('#zone-titre').css("height", (hauteurLogo+5)+"px"); |
$('#zone-titre').css("width", (largeurLogo+largeurTitre+16)+"px"); |
|
if(titreCarte != 'null' && titreCarte != 0) { |
235,6 → 245,8 |
$('#carte-titre-infos').css("left", (largeurLogo+16)+"px"); |
$('#carte-titre-infos').css("top", (hauteurLogo/2)+"px"); |
} |
} else { |
$('#zone-titre').css("height", (tailleMaxIcones+5)+"px"); |
} |
} |
|
248,12 → 260,18 |
var largeurTitre = $('#zone-titre').width(); |
var 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(); |
var largeurStats = $('#zone-stats').width(); |
var marge = (largeurViewPort - largeurStats)/2; |
var marge = ((largeurViewPort - largeurStats)/2) - 10; |
$('#zone-stats').css("left",marge); |
} |
|
322,6 → 340,7 |
|
var marqueurs = new Array(); |
function chargerMarqueurs(zoom, NELatLng, SWLatLng) { |
cacherMessageAucuneObs() |
var url = stationsUrl+ |
'&zoom='+zoom+ |
'&ne='+NELatLng+ |
364,9 → 383,14 |
|
function afficherMessageAucuneObs() { |
centrerDansLaPage($('#message-aucune-obs')); |
selecteur.show(); |
$('#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; |
480,8 → 504,10 |
} |
} |
|
var pointCentreAvantAffichageInfoBulle = null; |
function surClickMarqueur(event) { |
|
pointCentreAvantAffichageInfoBulle = map.getCenter(); |
|
if(infoBulleOuverte) { |
infoBulle.close(); |
} |
548,6 → 574,7 |
|
function surFermetureInfoBulle() { |
infoBulleOuverte = false; |
map.panTo(pointCentreAvantAffichageInfoBulle); |
programmerRafraichissementCarte(); |
} |
|
562,8 → 589,10 |
function afficherInfoBulle() { |
var obsHtml = $("#tpl-obs").html(); |
var largeur = definirLargeurInfoBulle(); |
var taillePolice = definirTaillePoliceInfoBulle(); |
obsHtml = obsHtml.replace(/\{largeur\}/, largeur); |
infoBulle.setContent(obsHtml); |
$('#observations').css('font-size',taillePolice+'em'); |
chargerObs(0, 0); |
infoBulleOuverte = true; |
} |
570,8 → 599,10 |
|
function definirLargeurInfoBulle() { |
var largeurViewPort = $(window).width(); |
var lageurInfoBulle = null; |
if (largeurViewPort < 800) { |
var largeurInfoBulle = null; |
if (largeurViewPort < 400) { |
largeurInfoBulle = 300; |
} else if (largeurViewPort < 800) { |
largeurInfoBulle = 400; |
} else if (largeurViewPort >= 800 && largeurViewPort < 1200) { |
largeurInfoBulle = 500; |
581,6 → 612,17 |
return largeurInfoBulle; |
} |
|
function definirTaillePoliceInfoBulle() { |
var largeurViewPort = $(window).width(); |
var 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); |
1013,23 → 1055,26 |
$(".plantes-nbre").text(taxonsCarte.length); |
$("#tpl-taxons-liste").tmpl({'taxons':taxonsCarte}).appendTo("#pl-corps"); |
$('.taxon').live('click', filtrerParTaxon); |
$('.raz-filtre-taxons').live('click', viderFiltreTaxon); |
} |
|
|
var largeurPanneauLateralFerme = null; |
function afficherPanneauLateral() { |
$('#panneau-lateral').height($(window).height()); |
$('#panneau-lateral').height($(window).height() - $('#panneau-lateral').offset().top); |
largeurPanneauLateralFerme = $('#panneau-lateral').width(); |
$('#panneau-lateral').width(300); |
$('#pl-contenu').css('display', 'block'); |
$('#pl-ouverture').css('display', 'none'); |
$('#pl-fermeture').css('display', 'block'); |
$('#panneau-lateral').css("top","0"); |
// 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("60px"); |
$('#panneau-lateral').width("83px"); |
$('#panneau-lateral').height("65px"); |
$('#panneau-lateral').width(largeurPanneauLateralFerme+"px"); |
$('#pl-contenu').css('display', 'none'); |
$('#pl-ouverture').css('display', 'block'); |
$('#pl-fermeture').css('display', 'none'); |
1037,6 → 1082,10 |
google.maps.event.trigger(map, 'resize'); |
}; |
|
function viderFiltreTaxon() { |
$('.taxon-actif .taxon').click(); |
} |
|
function filtrerParTaxon() { |
var ntAFiltrer = $('.nt', this).text(); |
infoBulle.close(); |