Subversion Repositories eFlore/Applications.cel

Rev

Rev 1442 | Rev 1447 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1442 Rev 1445
Line 154... Line 154...
154
}
154
}
Line 155... Line 155...
155
 
155
 
Line 156... Line 156...
156
function attribuerListenersOverlay() {
156
function attribuerListenersOverlay() {
157
	
157
	
158
	$(window).resize(function() {
158
	$(window).resize(function() {
159
		programmerRafraichissementCarte();
159
		google.maps.event.trigger($('#carte'), 'resize');
160
		definirTailleOverlay();
160
		definirTailleOverlay();
161
		centrerTitreEtStats();
161
		centrerTitreEtStats();
Line 162... Line 162...
162
		google.maps.event.trigger($('#carte'), 'resize');
162
		programmerRafraichissementCarte();
163
	});
163
	});
-
 
164
	
164
	
165
	$('#lien_plein_ecran a').click(function(event) {
Line 165... Line 166...
165
	$('#lien_plein_ecran a').click(function(event) {
166
		window.open(window.location.href);
166
		window.open(window.location.href);
167
		event.preventDefault();
-
 
168
	});
167
	});
169
	
168
	
170
	$('#lien_voir_cc a').click(function(event) {
Line 169... Line 171...
169
	$('#lien_voir_cc a').click(function(event) {
171
		window.open($(this).attr('href'));
170
		window.open($(this).attr('href'));
172
		event.preventDefault();
171
	});
173
	});
172
}
174
}
173
 
175
 
174
function definirTailleOverlay() {
176
function definirTailleOverlay() {
-
 
177
	var largeurViewPort = $(window).width();
175
	var largeurViewPort = $(window).width();
178
	var taille = '1.6';
176
	var taille = null;
179
	var tailleMaxLogo = 50;
177
	var tailleMaxLogo = 50;
180
	var tailleMaxIcones = 20;
178
	var tailleMaxIcones = 20;
181
	var padding_icones = 8;
-
 
182
	var tailleFiltre = 80;
179
	var padding_icones = 8;
183
	if (largeurViewPort <= 500) {
Line 180... Line 184...
180
	if (largeurViewPort <= 500) {
184
		taille = '0.8';
181
		taille = '0.8';
185
		tailleMaxLogo = 20;
182
		tailleMaxLogo = 20;
186
		tailleMaxIcones = 10;
183
		tailleMaxIcones = 10;
187
		tailleFiltre = 60;
184
		padding_icones = 2;
188
		padding_icones = 2;
-
 
189
		
185
		
190
	} else if (largeurViewPort > 500 && largeurViewPort <= 800) {
186
	} else if (largeurViewPort > 500 && largeurViewPort <= 800) {
191
		taille = '1.0';
187
		taille = '1.0';
192
		tailleMaxLogo = 40;
188
		tailleMaxLogo = 40;
193
		tailleMaxIcones = 15;
189
		tailleMaxIcones = 15;
194
		padding_icones = 6;
-
 
195
		tailleFiltre = 60;
190
		padding_icones = 6;
196
	} else if (largeurViewPort > 800) {
Line 191... Line 197...
191
	} else if (largeurViewPort > 800) {
197
		taille = '1.6';
192
		taille = '1.6';
198
		tailleMaxLogo = 50;
Line 205... Line 211...
205
	$('#lien_plein_ecran').css("padding", padding_icones+"px "+padding_icones+"px "+Math.ceil(padding_icones/2)+"px");
211
	$('#lien_plein_ecran').css("padding", padding_icones+"px "+padding_icones+"px "+Math.ceil(padding_icones/2)+"px");
206
	$('#lien_voir_cc').css("padding", padding_icones+"px "+padding_icones+"px "+Math.ceil(padding_icones/2)+"px");
212
	$('#lien_voir_cc').css("padding", padding_icones+"px "+padding_icones+"px "+Math.ceil(padding_icones/2)+"px");
Line 207... Line 213...
207
	
213
	
Line -... Line 214...
-
 
214
	$('#zone-stats').height(tailleMaxIcones*1.5);
-
 
215
	
-
 
216
	$("#panneau-lateral").css('font-size', (taille*0.80)+'em');
-
 
217
	$("#panneau-lateral").css('padding', padding_icones+"px "+padding_icones+"px "+Math.round(padding_icones/4)+"px");
208
	$('#zone-stats').height(tailleMaxIcones*1.5);
218
	$("#panneau-lateral").width(tailleFiltre);
209
	
219
	
210
	// Dimensionnement du titre et du logo
220
	// Dimensionnement du titre et du logo
211
	if(urlLogo != "null") {
221
	if(urlLogo != "null") {
212
		hauteurLogo = $('#logo img').height();
222
		hauteurLogo = $('#logo img').height();
Line 225... Line 235...
225
		}
235
		}
Line 226... Line 236...
226
		
236
		
227
		largeurLogo = $('#logo img').width();
237
		largeurLogo = $('#logo img').width();
Line 228... Line 238...
228
		largeurTitre = $('#carte-titre-infos').width();
238
		largeurTitre = $('#carte-titre-infos').width();
229
		
239
		
Line 230... Line 240...
230
		$('#zone-titre').css("height", (hauteurLogo)+"px");
240
		$('#zone-titre').css("height", (hauteurLogo+5)+"px");
231
		$('#zone-titre').css("width", (largeurLogo+largeurTitre+16)+"px");
241
		$('#zone-titre').css("width", (largeurLogo+largeurTitre+16)+"px");
232
		
242
		
233
		if(titreCarte != 'null' && titreCarte != 0) {
243
		if(titreCarte != 'null' && titreCarte != 0) {
234
			$('#carte-titre-infos').css("position", "absolute");
244
			$('#carte-titre-infos').css("position", "absolute");
-
 
245
			$('#carte-titre-infos').css("left", (largeurLogo+16)+"px");
-
 
246
			$('#carte-titre-infos').css("top", (hauteurLogo/2)+"px");
235
			$('#carte-titre-infos').css("left", (largeurLogo+16)+"px");
247
		}
236
			$('#carte-titre-infos').css("top", (hauteurLogo/2)+"px");
248
	} else {
Line 237... Line 249...
237
		}
249
		$('#zone-titre').css("height", (tailleMaxIcones+5)+"px");
238
	}
250
	}
Line 246... Line 258...
246
function centrerTitre() {
258
function centrerTitre() {
247
	var largeurViewPort = $(window).width();
259
	var largeurViewPort = $(window).width();
248
	var largeurTitre = $('#zone-titre').width();
260
	var largeurTitre = $('#zone-titre').width();
249
	var marge = (largeurViewPort - largeurTitre)/2;
261
	var marge = (largeurViewPort - largeurTitre)/2;
250
	$('#zone-titre').css("margin-left",marge);
262
	$('#zone-titre').css("margin-left",marge);
-
 
263
	var tailleRestante = largeurViewPort - (marge + largeurTitre);
-
 
264
	if(tailleRestante <= 170) {
-
 
265
		$('#zone-titre').css("top", "25px");
-
 
266
	} else {
-
 
267
		$('#zone-titre').css("top", "5px");
-
 
268
	}
251
}
269
}
Line 252... Line 270...
252
 
270
 
253
function centrerStats() {
271
function centrerStats() {
254
	var largeurViewPort = $(window).width();
272
	var largeurViewPort = $(window).width();
255
	var largeurStats = $('#zone-stats').width();
273
	var largeurStats = $('#zone-stats').width();
256
	var marge = (largeurViewPort - largeurStats)/2;
274
	var marge = ((largeurViewPort - largeurStats)/2) - 10;
257
	$('#zone-stats').css("left",marge);
275
	$('#zone-stats').css("left",marge);
Line 258... Line 276...
258
}
276
}
259
 
277
 
Line 320... Line 338...
320
    }, 400);		
338
    }, 400);		
321
}
339
}
Line 322... Line 340...
322
 
340
 
323
var marqueurs = new Array();
341
var marqueurs = new Array();
-
 
342
function chargerMarqueurs(zoom, NELatLng, SWLatLng) {
324
function chargerMarqueurs(zoom, NELatLng, SWLatLng) {
343
	cacherMessageAucuneObs()
325
	var url = stationsUrl+
344
	var url = stationsUrl+
326
		'&zoom='+zoom+
345
		'&zoom='+zoom+
327
		'&ne='+NELatLng+
346
		'&ne='+NELatLng+
Line 362... Line 381...
362
	$('#zone-chargement-point').css('display','none');
381
	$('#zone-chargement-point').css('display','none');
363
}
382
}
Line 364... Line 383...
364
 
383
 
365
function afficherMessageAucuneObs() {
384
function afficherMessageAucuneObs() {
366
	centrerDansLaPage($('#message-aucune-obs'));
385
	centrerDansLaPage($('#message-aucune-obs'));
-
 
386
	$('#message-aucune-obs').show();
-
 
387
}
-
 
388
 
-
 
389
function cacherMessageAucuneObs() {
-
 
390
	centrerDansLaPage($('#message-aucune-obs'));
367
	selecteur.show();
391
	$('#message-aucune-obs').hide();
Line 368... Line 392...
368
}
392
}
369
 
393
 
370
premierChargement = true;
394
premierChargement = true;
Line 478... Line 502...
478
	} else if (etreMarqueurGroupe(id)) {
502
	} else if (etreMarqueurGroupe(id)) {
479
		google.maps.event.addListener(marqueur, 'click', surClickGroupe);
503
		google.maps.event.addListener(marqueur, 'click', surClickGroupe);
480
	}
504
	}
481
}
505
}
Line -... Line 506...
-
 
506
 
482
 
507
var pointCentreAvantAffichageInfoBulle = null;
-
 
508
function surClickMarqueur(event) {
483
function surClickMarqueur(event) {
509
	pointCentreAvantAffichageInfoBulle = map.getCenter();
484
 
510
	
485
	if(infoBulleOuverte) {
511
	if(infoBulleOuverte) {
486
	    infoBulle.close();
512
	    infoBulle.close();
Line 487... Line 513...
487
	}
513
	}
Line 546... Line 572...
546
	google.maps.event.addListener(infoBulle, 'content_changed', definirLargeurInfoBulle);
572
	google.maps.event.addListener(infoBulle, 'content_changed', definirLargeurInfoBulle);
547
}
573
}
Line 548... Line 574...
548
 
574
 
549
function surFermetureInfoBulle() {
575
function surFermetureInfoBulle() {
-
 
576
	infoBulleOuverte = false;
550
	infoBulleOuverte = false;
577
	map.panTo(pointCentreAvantAffichageInfoBulle);
551
	programmerRafraichissementCarte();
578
	programmerRafraichissementCarte();
Line 552... Line 579...
552
}
579
}
553
 
580
 
Line 560... Line 587...
560
}
587
}
Line 561... Line 588...
561
 
588
 
562
function afficherInfoBulle() {
589
function afficherInfoBulle() {
563
	var obsHtml = $("#tpl-obs").html();
590
	var obsHtml = $("#tpl-obs").html();
-
 
591
	var largeur = definirLargeurInfoBulle();
564
	var largeur = definirLargeurInfoBulle();
592
	var taillePolice = definirTaillePoliceInfoBulle();
565
	obsHtml = obsHtml.replace(/\{largeur\}/, largeur);
593
	obsHtml = obsHtml.replace(/\{largeur\}/, largeur);
-
 
594
	infoBulle.setContent(obsHtml);
566
	infoBulle.setContent(obsHtml);
595
	$('#observations').css('font-size',taillePolice+'em');
567
	chargerObs(0, 0);
596
	chargerObs(0, 0);
568
	infoBulleOuverte = true;
597
	infoBulleOuverte = true;
Line 569... Line 598...
569
}
598
}
570
 
599
 
571
function definirLargeurInfoBulle() {
600
function definirLargeurInfoBulle() {
572
	var largeurViewPort = $(window).width();
601
	var largeurViewPort = $(window).width();
-
 
602
	var largeurInfoBulle = null;
-
 
603
	if (largeurViewPort < 400) {
573
	var lageurInfoBulle = null;
604
		largeurInfoBulle = 300;
574
	if (largeurViewPort < 800) {
605
	} else if (largeurViewPort < 800) {
575
		largeurInfoBulle = 400;
606
		largeurInfoBulle = 400;
576
	} else if (largeurViewPort >= 800 && largeurViewPort < 1200) {
607
	} else if (largeurViewPort >= 800 && largeurViewPort < 1200) {
577
		largeurInfoBulle = 500;
608
		largeurInfoBulle = 500;
578
	} else if (largeurViewPort >= 1200) {
609
	} else if (largeurViewPort >= 1200) {
579
		largeurInfoBulle = 600;
610
		largeurInfoBulle = 600;
580
	}
611
	}
Line -... Line 612...
-
 
612
	return largeurInfoBulle;
-
 
613
}
-
 
614
 
-
 
615
function definirTaillePoliceInfoBulle() {
-
 
616
	var largeurViewPort = $(window).width();
-
 
617
	var taillePolice = null;
-
 
618
	if (largeurViewPort < 400) {
-
 
619
		taillePolice = 0.8;
-
 
620
	} else if (largeurViewPort < 800) {
-
 
621
		taillePolice = 1;
-
 
622
	}
581
	return largeurInfoBulle;
623
	return taillePolice;
582
}
624
}
583
 
625
 
584
function afficherMessageChargement(element) {
626
function afficherMessageChargement(element) {
585
	if ($('#chargement').get() == '') {
627
	if ($('#chargement').get() == '') {
Line 1011... Line 1053...
1011
 
1053
 
1012
function afficherTaxons() {
1054
function afficherTaxons() {
1013
	$(".plantes-nbre").text(taxonsCarte.length);
1055
	$(".plantes-nbre").text(taxonsCarte.length);
1014
	$("#tpl-taxons-liste").tmpl({'taxons':taxonsCarte}).appendTo("#pl-corps");
1056
	$("#tpl-taxons-liste").tmpl({'taxons':taxonsCarte}).appendTo("#pl-corps");
-
 
1057
	$('.taxon').live('click', filtrerParTaxon);
1015
	$('.taxon').live('click', filtrerParTaxon);
1058
	$('.raz-filtre-taxons').live('click', viderFiltreTaxon);
Line 1016... Line -...
1016
}
-
 
-
 
1059
}
1017
 
1060
 
1018
 
1061
var largeurPanneauLateralFerme = null;
-
 
1062
function afficherPanneauLateral() {
1019
function afficherPanneauLateral() {
1063
	$('#panneau-lateral').height($(window).height() - $('#panneau-lateral').offset().top);
1020
	$('#panneau-lateral').height($(window).height());
1064
	largeurPanneauLateralFerme = $('#panneau-lateral').width();
1021
	$('#panneau-lateral').width(300);
1065
	$('#panneau-lateral').width(300);
1022
	$('#pl-contenu').css('display', 'block');
1066
	$('#pl-contenu').css('display', 'block');
1023
	$('#pl-ouverture').css('display', 'none');
1067
	$('#pl-ouverture').css('display', 'none');
-
 
1068
	$('#pl-fermeture').css('display', 'block');
Line 1024... Line 1069...
1024
	$('#pl-fermeture').css('display', 'block');
1069
	// correction pour la taille de la liste des taxons
1025
	$('#panneau-lateral').css("top","0");
1070
	$('#pl-corps').height($(window).height() - $('#pl-corps').offset().top);
Line 1026... Line 1071...
1026
 
1071
 
1027
	google.maps.event.trigger(map, 'resize');
1072
	google.maps.event.trigger(map, 'resize');
1028
};
1073
};
1029
 
1074
 
1030
function cacherPanneauLateral() {
1075
function cacherPanneauLateral() {
1031
	$('#panneau-lateral').height("60px");
1076
	$('#panneau-lateral').height("65px");
Line 1032... Line 1077...
1032
	$('#panneau-lateral').width("83px");
1077
	$('#panneau-lateral').width(largeurPanneauLateralFerme+"px");
1033
	$('#pl-contenu').css('display', 'none');
1078
	$('#pl-contenu').css('display', 'none');
Line -... Line 1079...
-
 
1079
	$('#pl-ouverture').css('display', 'block');
-
 
1080
	$('#pl-fermeture').css('display', 'none');
-
 
1081
	
-
 
1082
	google.maps.event.trigger(map, 'resize');
1034
	$('#pl-ouverture').css('display', 'block');
1083
};
1035
	$('#pl-fermeture').css('display', 'none');
1084
 
1036
	
1085
function viderFiltreTaxon() {
1037
	google.maps.event.trigger(map, 'resize');
1086
	$('.taxon-actif .taxon').click();
1038
};
1087
}