Subversion Repositories eFlore/Applications.cel

Rev

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

Rev 1100 Rev 1137
Line 1... Line 1...
1
/*+--------------------------------------------------------------------------------------------------------+*/
1
/*+--------------------------------------------------------------------------------------------------------+*/
2
// PARAMÊTRES et CONSTANTES
2
// PARAMÊTRES et CONSTANTES
3
// Mettre à true pour afficher les messages de débogage
3
// Mettre à true pour afficher les messages de débogage
4
var DEBUG = false; 
4
var DEBUG = false; 
-
 
5
/**
5
var communeImageUrl = 'http://www.tela-botanica.org/commun/icones/carto/commune.png';
6
 * Indication de certaines variables ajoutée par php
-
 
7
* var communeImageUrl ;
6
var pointImageUrl = 'http://www.tela-botanica.org/commun/icones/carto/point2.png';
8
* var pointImageUrl ;
7
var groupeImageUrlTpl = 'http://www.tela-botanica.org/service:cel:CelWidgetMapPoint/icone-groupe?type={type}&nbre={nbre}'
9
* var groupeImageUrlTpl ;
-
 
10
*/
8
var pointsOrigine = null;
11
var pointsOrigine = null;
9
var boundsOrigine = null;
12
var boundsOrigine = null;
10
var markerClusterer = null;
13
var markerClusterer = null;
11
var map = null;
14
var map = null;
12
var infoBulle = new google.maps.InfoWindow();
15
var infoBulle = new google.maps.InfoWindow();
Line 136... Line 139...
136
 
139
 
137
function chargerLimitesCommunales() {
140
function chargerLimitesCommunales() {
138
	if (urlsLimitesCommunales != null) {
141
	if (urlsLimitesCommunales != null) {
139
		for (urlId in urlsLimitesCommunales) { 
142
		for (urlId in urlsLimitesCommunales) { 
140
			var url = urlsLimitesCommunales[urlId];
143
			var url = urlsLimitesCommunales[urlId];
141
			ctaLayer = new google.maps.KmlLayer(url, {preserveViewport: false});
144
			ctaLayer = new google.maps.KmlLayer(url, {preserveViewport: true});
142
			ctaLayer.setMap(map);
145
			ctaLayer.setMap(map);
143
		}
146
		}
144
	}
147
	}
Line 198... Line 201...
198
 
201
 
199
function cacherMessageChargementPoints() {
202
function cacherMessageChargementPoints() {
200
	$('#zone-chargement-point').css('display','none');
203
	$('#zone-chargement-point').css('display','none');
Line -... Line 204...
-
 
204
}
-
 
205
 
201
}
206
premierChargement = true;
202
 
207
 
203
function rafraichirMarqueurs(data) {
208
function rafraichirMarqueurs(data) {
204
	$.each(marqueurs, function(index, marqueur) {
209
	$.each(marqueurs, function(index, marqueur) {
205
		marqueur.setMap(null);
210
		marqueur.setMap(null);
Line 213... Line 218...
213
		if(station != null) {
218
		if(station != null) {
214
			var nouveauMarqueur = creerMarqueur(station);
219
			var nouveauMarqueur = creerMarqueur(station);
215
			marqueurs.push(nouveauMarqueur);
220
			marqueurs.push(nouveauMarqueur);
216
		}
221
		}
217
	});
222
	});
-
 
223
	
-
 
224
	if(premierChargement) {
-
 
225
		premierChargement = false;
-
 
226
		var bounds = new google.maps.LatLngBounds();
-
 
227
		var latMax = new google.maps.LatLng(data.stats.coordmax.latMax, data.stats.coordmax.lngMax);
-
 
228
		var latMin = new google.maps.LatLng(data.stats.coordmax.latMin, data.stats.coordmax.lngMin);
-
 
229
		bounds.extend(latMax);
-
 
230
		bounds.extend(latMin);
-
 
231
		rendrePointsVisibles(bounds);	
-
 
232
	}
218
}
233
}
Line 219... Line 234...
219
 
234
 
220
function creerMarqueur(station) {
235
function creerMarqueur(station) {
221
	var titre = '';
236
	var titre = '';
Line 452... Line 467...
452
			viderTableauObs();
467
			viderTableauObs();
453
		}
468
		}
Line 454... Line 469...
454
		
469
		
455
		var urlObs = observationsUrl+'&start={start}&limit='+limite;
470
		var urlObs = observationsUrl+'&start={start}&limit='+limite;
-
 
471
		urlObs = urlObs.replace(/\{stationId\}/g, pointClique.stationInfos.id);
-
 
472
		if (pointClique.stationInfos.type_emplacement == 'communes') {
-
 
473
			urlObs = urlObs.replace(/commune=%2A/g, 'commune='+pointClique.stationInfos.nom);
456
		urlObs = urlObs.replace(/\{stationId\}/g, pointClique.stationInfos.id);
474
		}
457
		urlObs = urlObs.replace(/\{nt\}/g, nt);
475
		urlObs = urlObs.replace(/\{nt\}/g, nt);
Line 458... Line 476...
458
		urlObs = urlObs.replace(/\{start\}/g, depart);
476
		urlObs = urlObs.replace(/\{start\}/g, depart);
459
		
477
		
Line 472... Line 490...
472
function surRetourChargementObs(observations, depart, total) {
490
function surRetourChargementObs(observations, depart, total) {
473
	obsStation = obsStation.concat(observations.observations);
491
	obsStation = obsStation.concat(observations.observations);
474
	if (depart == 0) {
492
	if (depart == 0) {
475
		actualiserInfosStation(observations);
493
		actualiserInfosStation(observations);
476
		creerTitreInfoBulle();
494
		creerTitreInfoBulle();
477
		selectionnerOnglet("#obs-vue-"+pagineur.format);
-
 
478
		surClicPagePagination(0, null);
495
		surClicPagePagination(0, null);	
479
	}
496
	}
Line 480... Line 497...
480
	
497
	
481
	afficherPagination();
498
	afficherPagination();
-
 
499
	actualiserPagineur();
482
	actualiserPagineur();
500
	selectionnerOnglet("#obs-vue-"+pagineur.format);
Line 483... Line 501...
483
}
501
}
484
 
502
 
485
function actualiserInfosStation(infos) {
503
function actualiserInfosStation(infos) {