1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| function LocalisationAvecLambert(adresse ,nom ,lat,lgt,emplacement,prop,TP,statut,auto,ddauto,dfauto,superficie,redevance,somme) {
var lt = parseFloat(lat.replace(',','.'));
var lg = parseFloat(lgt.replace(',','.'));
// creating source and destination Proj4js objects
// once initialized, these may be re-used as often as needed
var Source = new Proj4js.Proj('EPSG:27563'); //Source coordinates in LCC, south of France
var Destination = new Proj4js.Proj('EPSG:4326'); //Destination coordinates will be in Longitude/Latitude
// transforming point coordinates
var p = new Proj4js.Point(-76.0,45.0); //any object will do as long as it has 'x' and 'y' properties
Proj4js.transform(Source, Destination, p); //do the transformation. x and y are modified in place
lt=p.x;
lg=p.y;
document.getElementById('latitude').value.value=p.x;
document.getElementById('longitude').value=p.y;
....} |
Partager