Subversion Repositories eFlore/Applications.coel

Compare Revisions

Ignore whitespace Rev 1702 → Rev 1703

/trunk/widget/modules/cartodepartement/squelettes/scripts/carto.js
37,7 → 37,7
$.ajax({
dataType: "json",
url: urlWebService + "CoelRecherche/Nombre/*/*/*/*/*/*/" + departement + "/*/*/",
data: { formatRetour: "text/plain" },
data: { formatRetour: "text/plain", pays: pays },
async: false
}).complete(function(msg) {
if (! estStatutRequeteOK(msg.status)) {
90,13 → 90,24
function chargerStructures() {
if (requeteEnCours()) {
window.setTimeout('chargerStructures()', 400);
} else {
chargementEnCours = true;
var url = urlWebService+"CoelRecherche/ParDefaut/*/*/*/*/*/*/"+departement+"/*/*/?limit="+nombreCollections;
xmlHttpRequest = $.getJSON(url).complete(function() {
traiterLocalisationsJSON();
});
return;
}
 
chargementEnCours = true;
$.ajax({
dataType: "json",
url: urlWebService + "CoelRecherche/ParDefaut/*/*/*/*/*/*/" + departement + "/*/*/",
data: { limit: nombreCollections, pays: pays },
async: true
}).complete(function(msg) {
if (!estStatutRequeteOK(msg.status)) {
alert(msg.responseText);
return;
}
collections = eval("(function(){return " + msg.responseText + ";})()");
ordonnerCollectionsParStructures();
chargerLocalisations();
});
}
 
function requeteEnCours() {
107,17 → 118,6
return (x_status == 200 || x_status == 304 || x_status == 0);
}
 
function traiterLocalisationsJSON() {
var texte = xmlHttpRequest.responseText;
if (!estStatutRequeteOK(xmlHttpRequest.status)) {
alert(texte);
} else {
collections = eval("(function(){return " + texte + ";})()");
ordonnerCollectionsParStructures();
chargerLocalisations();
}
}
 
function ordonnerCollectionsParStructures() {
for (var index = 0; index < collections.length; index ++) {
var indexStructure = 0;