Subversion Repositories eFlore/Applications.cel

Rev

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

Rev 1271 Rev 1342
Line 197... Line 197...
197
    }
197
    }
198
	if(requeteChargementPoints != null) {
198
	if(requeteChargementPoints != null) {
199
		requeteChargementPoints.abort();
199
		requeteChargementPoints.abort();
200
	}
200
	}
201
	timer = window.setTimeout(function() {
201
	timer = window.setTimeout(function() {
-
 
202
		if(map.getBounds() != undefined) {
202
		var zoom = map.getZoom();
203
			var zoom = map.getZoom();
203
		var NELatLng = (map.getBounds().getNorthEast().lat())+'|'+(map.getBounds().getNorthEast().lng());
204
			var NELatLng = (map.getBounds().getNorthEast().lat())+'|'+(map.getBounds().getNorthEast().lng());
204
		var SWLatLng = (map.getBounds().getSouthWest().lat())+'|'+(map.getBounds().getSouthWest().lng());
205
			var SWLatLng = (map.getBounds().getSouthWest().lat())+'|'+(map.getBounds().getSouthWest().lng());
205
		chargerMarqueurs(zoom, NELatLng, SWLatLng);
206
			chargerMarqueurs(zoom, NELatLng, SWLatLng);
-
 
207
		} else {
-
 
208
			programmerRafraichissementCarte();
-
 
209
		}
206
    }, 400);		
210
    }, 400);		
207
}
211
}
Line 208... Line 212...
208
 
212
 
209
var marqueurs = new Array();
213
var marqueurs = new Array();
Line 478... Line 482...
478
		}
482
		}
Line 479... Line 483...
479
		
483
		
480
		var urlObs = observationsUrl+'&start={start}&limit='+limite;
484
		var urlObs = observationsUrl+'&start={start}&limit='+limite;
481
		urlObs = urlObs.replace(/\{stationId\}/g, encodeURIComponent(pointClique.stationInfos.id));
485
		urlObs = urlObs.replace(/\{stationId\}/g, encodeURIComponent(pointClique.stationInfos.id));
482
		if (pointClique.stationInfos.type_emplacement == 'communes') {
486
		if (pointClique.stationInfos.type_emplacement == 'communes') {
483
			urlObs = urlObs.replace(/commune=%2A/g, 'commune='+encodeURIComponent(pointClique.stationInfos.nom));
487
			urlObs = urlObs.replace(/commune=%2A/g, formaterParametreCommunePourRequete(pointClique.stationInfos.nom));
484
		}
488
		}
485
		urlObs = urlObs.replace(/\{nt\}/g, nt);
489
		urlObs = urlObs.replace(/\{nt\}/g, nt);
Line 486... Line 490...
486
		urlObs = urlObs.replace(/\{start\}/g, depart);
490
		urlObs = urlObs.replace(/\{start\}/g, depart);
Line 490... Line 494...
490
			chargerObs(depart+limite, observations.total);
494
			chargerObs(depart+limite, observations.total);
491
		});
495
		});
492
	}
496
	}
493
}
497
}
Line -... Line 498...
-
 
498
 
-
 
499
function formaterParametreCommunePourRequete(nomCommune) {
-
 
500
	var chaineRequete = "";
-
 
501
	if(nomCommune.indexOf("(", 0) !== false) {
-
 
502
		var infosCommune = nomCommune.split("(");
-
 
503
		var commune = infosCommune[0];
-
 
504
		chaineRequete = 'commune='+encodeURIComponent($.trim(commune));
-
 
505
	} else {
-
 
506
		chaineRequete = 'commune='+encodeURIComponent($.trim(nomCommune));
-
 
507
	}
-
 
508
	return chaineRequete;
-
 
509
}
494
 
510
 
495
function viderTableauObs() {
511
function viderTableauObs() {
496
	obsStation = new Array();	
512
	obsStation = new Array();	
497
	surClicPagePagination(0, null);
513
	surClicPagePagination(0, null);