22,6 → 22,7 |
this.initialiserGoogleMap(); |
this.afficherEtapeGeolocalisation(1); |
|
var lthis = this; |
$('#carte-recherche').autocomplete({ |
//Cette partie utilise geocoder pour extraire des valeurs d'adresse |
source: function(request, response) { |
60,12 → 61,8 |
|
//surcharge |
WidgetSaisieSauvages.prototype.initForm = function() { |
//this.requeterIdentite();// Sur rechargement de la page |
// Gestion de la liste des taxons |
this.configurerDatePicker('#date'); |
this.ajouterAutocompletionNoms(); |
this.configurerFormValidator(); |
this.definirReglesFormValidator(); |
// super() à la main - toute autre manière de faire est über-komplex |
WidgetSaisie.prototype.initForm.call(this); |
|
this.surChangementTaxonListe(); |
$('#taxon-liste').on('change', this.surChangementTaxonListe); |
190,9 → 187,7 |
google.maps.event.addListenerOnce(this.map, 'idle', function(){ |
// Initialisation du marker de début de rue |
lthis.initialiserMarkerDeb(); |
if (this.obsId != '') { |
lthis.chargerInfoObs(); |
} else { |
if (this.obsId == '') { |
// Tentative de geocalisation si aucune obs à précharger |
lthis.tenterGeolocalisation(); |
} |
202,6 → 197,10 |
this.geocoder = new google.maps.Geocoder(); |
}; |
|
WidgetSaisieSauvages.prototype.surClickDansCarte = function(event) { |
this.deplacerMarkerDeb(event.latLng); |
}; |
|
// surcharge |
WidgetSaisieSauvages.prototype.prechargerForm = function(data) { |
|
226,7 → 225,7 |
var deb = new google.maps.LatLng(data.extension.latitudeDebutRue.valeur, data.extension.longitudeDebutRue.valeur); |
var fin = new google.maps.LatLng(data.extension.latitudeFinRue.valeur, data.extension.longitudeFinRue.valeur); |
|
this.mettreAJourStationPosition(pos); |
this.mettreAJourMarkerPosition(pos); |
|
this.deplacerMarkerDeb(deb); |
this.deplacerMarkerFin(fin); |
274,7 → 273,7 |
this.latLngDeb = nouvellePosition; |
this.markerDeb.setPosition(this.latLngDeb); |
this.map.setCenter(this.latLngDeb); |
this.mettreAJourStationPosition(this.latLngDeb); |
this.mettreAJourMarkerPosition(this.latLngDeb); |
this.trouverCommune(this.latLngDeb); |
|
if (this.premierDeplacement) { |
335,16 → 334,9 |
this.latLngDeb = this.markerDeb.getPosition(); |
this.latLngFin = this.markerFin.getPosition(); |
this.latLngCentre = new google.maps.LatLng((this.latLngFin.lat() + this.latLngDeb.lat())/2, (this.latLngFin.lng() + this.latLngDeb.lng())/2); |
this.mettreAJourStationPosition(this.latLngCentre); |
this.mettreAJourMarkerPosition(this.latLngCentre); |
}; |
|
WidgetSaisieSauvages.prototype.mettreAJourStationPosition = function(latLng) { |
var lat = latLng.lat().toFixed(5), |
lng = latLng.lng().toFixed(5); |
this.remplirChampLatitude(lat); |
this.remplirChampLongitude(lng); |
}; |
|
WidgetSaisieSauvages.prototype.afficherEtapeGeolocalisation = function(numEtape) { |
$('.liste_indication_geolocalisation').children().hide(); |
$('.liste_indication_geolocalisation :nth-child('+numEtape+')').show(); |
751,12 → 743,12 |
nomSpecial = $('#taxon-liste option:selected').hasClass('nom-special'), |
numNomSel = nomHorsListe ? $('#taxon').data('numNomSel') : $('#taxon-liste').val(), |
nomSel = nomHorsListe ? $('#taxon').val() : $('#taxon-liste option:selected').data('nom-a-sauver'), |
nomRet = nomHorsListe ? $('#taxon').data('nomRet') : taxons[numNomSel]['nom_ret'], |
numNomRet = nomHorsListe ? $('#taxon').data('numNomRet') : taxons[numNomSel]['num_nom_ret'], |
numTaxon = nomHorsListe ? $('#taxon').data('nt') : taxons[numNomSel]['num_taxon'], |
famille = nomHorsListe ? $('#taxon').data('famille') : taxons[numNomSel]['famille'], |
nomRet = nomHorsListe ? $('#taxon').data('nomRet') : this.taxons[numNomSel]['nom_ret'], |
numNomRet = nomHorsListe ? $('#taxon').data('numNomRet') : this.taxons[numNomSel]['num_nom_ret'], |
numTaxon = nomHorsListe ? $('#taxon').data('nt') : this.taxons[numNomSel]['num_taxon'], |
famille = nomHorsListe ? $('#taxon').data('famille') : this.taxons[numNomSel]['famille'], |
referentiel = (numNomSel == undefined) ? '' : this.nomSciReferentiel, |
notes = (nomSpecial ? taxons[numNomSel]['nom_fr'] + '. ' : '') + $('#notes').val(); |
notes = (nomSpecial ? this.taxons[numNomSel]['nom_fr'] + '. ' : '') + $('#notes').val(); |
|
certitude = $('input[name=certitude]:checked').val(); |
certitude = (certitude == undefined) ? '' : certitude; |