266,10 → 266,17 |
|
function initialiserGoogleMap(){ |
// Carte |
var latLng = new google.maps.LatLng(48.8543, 2.3483);// Paris |
if(REFERENTIEL_IMPOSE && NOM_SCI_PROJET == 'bdtxa') { |
var latLng = new google.maps.LatLng(14.6, -61.08334);// Fort-De-France |
// Les antilles étant dispersées, un zoom moins précis est préférable |
var zoomDefaut = 8; |
} else { |
var latLng = new google.maps.LatLng(48.8543, 2.3483);// Paris |
var zoomDefaut = 16; |
} |
|
var options = { |
zoom: 16, |
zoom: zoomDefaut, |
center: latLng, |
mapTypeId: google.maps.MapTypeId.HYBRID, |
mapTypeControlOptions: { |
346,7 → 353,15 |
|
function trouverCommune(pos) { |
$(function() { |
var urlNomCommuneFormatee = SERVICE_NOM_COMMUNE_URL.replace('{lat}', pos.lat()).replace('{lon}', pos.lng()); |
|
var url_service = SERVICE_NOM_COMMUNE_URL; |
/*if(NOM_SCI_PROJET != "bdtfx") { |
// Dans le cas d'autres référentiels comme les Antilles, on utilise |
// une localisation mondiale mais approximative (c'est mieux que rien) |
url_service = SERVICE_NOM_COMMUNE_URL_ALT |
}*/ |
|
var urlNomCommuneFormatee = url_service.replace('{lat}', pos.lat()).replace('{lon}', pos.lng()); |
$.ajax({ |
url : urlNomCommuneFormatee, |
type : "GET", |
496,6 → 511,8 |
$("body").on('click', ".supprimer-obs", supprimerObs); |
|
$("#transmettre-obs").on('click', transmettreObs); |
|
$("#referentiel").on('change', surChangementReferentiel); |
}); |
|
function configurerFormValidator() { |
676,7 → 693,7 |
'<ul class="unstyled">'+ |
'<li>'+ |
'<span class="nom-sci">'+$("#taxon").val()+'</span> '+ |
ajouterNumNomSel()+ |
ajouterNumNomSel()+'<span class="referentiel-obs">['+NOM_SCI_PROJET+']</span>'+ |
' observé à '+ |
'<span class="commune">'+$('#commune-nom').text()+'</span> '+ |
'('+$('#commune-code-insee').text()+') ['+$("#latitude").val()+' / '+$("#longitude").val()+']'+ |
726,6 → 743,12 |
}); |
} |
|
function surChangementReferentiel() { |
NOM_SCI_PROJET = $('#referentiel').val(); |
NOM_SCI_REFERENTIEL = NOM_SCI_PROJET+':'+PROJETS_VERSIONS[NOM_SCI_PROJET]; |
$('#taxon').val(''); |
} |
|
function surChangementNbreObs() { |
if (obsNbre == 0) { |
$("#transmettre-obs").attr('disabled', 'disabled'); |
919,7 → 942,8 |
|
function getUrlAutocompletionNomsSci() { |
var mots = $('#taxon').val(); |
var url = SERVICE_AUTOCOMPLETION_NOM_SCI_URL.replace('{masque}', mots); |
var url = SERVICE_AUTOCOMPLETION_NOM_SCI_URL_TPL.replace('{referentiel}',NOM_SCI_PROJET); |
url = url.replace('{masque}', mots); |
return url; |
} |
|