406,7 → 406,8 |
if (this.marker != undefined) { |
this.marker.setPosition(latLng); |
this.map.setCenter(latLng); |
this.mettreAJourMarkerPosition(latLng); |
// au chargement de la carte, la position est nulle |
this.viderMarkerPosition(); |
} |
}; |
|
419,6 → 420,11 |
} |
}; |
|
WidgetSaisie.prototype.viderMarkerPosition = function() { |
this.remplirChampLatitude(null); |
this.remplirChampLongitude(null); |
}; |
|
WidgetSaisie.prototype.mettreAJourMarkerPosition = function(latLng) { |
var lat = latLng.lat().toFixed(5); |
var lng = latLng.lng().toFixed(5); |
426,13 → 432,27 |
this.remplirChampLongitude(lng); |
}; |
|
/** |
* Définit la valeur de latitude, à travers la "value" du champ "#latitude"; |
* pour définir une valeur vraiment vide (et non 0), passer null en argument |
*/ |
WidgetSaisie.prototype.remplirChampLatitude = function(latDecimale) { |
var lat = Math.round(latDecimale * 100000) / 100000; |
var lat = ''; |
if (latDecimale !== null) { |
lat = Math.round(latDecimale * 100000) / 100000; |
} |
$('#latitude').val(lat); |
}; |
|
/** |
* Définit la valeur de longitude, à travers la "value" du champ "#longitude"; |
* pour définir une valeur vraiment vide (et non 0), passer null en argument |
*/ |
WidgetSaisie.prototype.remplirChampLongitude = function(lngDecimale) { |
var lng = Math.round(lngDecimale * 100000) / 100000; |
var lng = ''; |
if (lngDecimale !== null) { |
lng = Math.round(lngDecimale * 100000) / 100000; |
} |
$('#longitude').val(lng); |
}; |
|