Subversion Repositories eFlore/Applications.cel

Compare Revisions

Ignore whitespace Rev 2255 → Rev 2256

/trunk/widget/modules/saisie/squelettes/defaut/js/defaut.js
454,13 → 454,50
afficherPanneau("#dialogue-courriel-introuvable");
}
//+---------------------------------------------------------------------------------------------------------+
//FORMULAIRE VALIDATION
//FORMULAIRE
$(document).ready(function() {
if (OBS_ID != '') {
chargerInfoObs();
}
});
 
function chargerInfoObs() {
var urlObs = SERVICE_OBS_URL + '/' + OBS_ID;
$.ajax({
url: urlObs,
type: 'GET',
success: function(data, textStatus, jqXHR) {
if (data != undefined && data != "") {
prechargerForm(data);
}
// TODO: voir s'il est pertinent d'indiquer quelque chose en cas d'erreur ou d'obs
// inexistante
},
error: function(jqXHR, textStatus, errorThrown) {
// TODO: cf TODO ci-dessus
}
});
}
 
function prechargerForm(data) {
$("#milieu").val(data.milieu);
});
//+---------------------------------------------------------------------------------------------------------+
// FORMULAIRE
$("#carte-recherche").val(data.zoneGeo);
$("#commune-nom").text(data.zoneGeo);
// TODO: trouver un moyen qui fonctionne lorsqu'on aura d'autres référentiels que INSEE
$("#commune-code-insee").text(data.codeZoneGeo.replace('INSEE-C:', ''));
if(data.hasOwnProperty("latitude") && data.hasOwnProperty("longitude")) {
var latLng = new google.maps.LatLng(data.latitude, data.longitude);
mettreAJourMarkerPosition(latLng);
marker.setPosition(latLng);
map.setCenter(latLng);
map.setZoom(16);
}
}
 
var obsNbre = 0;
 
$(document).ready(function() {