Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

230
Views
Angular: Converting number to WGS84 format

I´m looking for a solution to convert coordinates. Is there any pipe | service | function by which I am able to convert numbers to WGS84 format? Thank you very much for any help.

Longitude: 11.111111
Latitude: 22.22222
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Example of converting to Degree, Minutes, Seconds (DMS). Once you have this you can then add the degree, minutes, and seconds signs if you prefer. You can also position the letters (NSWE) before or after the output string.

function toDMS(LAT,LNG) {
const toDMS=coord=>{min=~~(minA=((a=Math.abs(coord))-(deg=~~a))*60);
return deg+" "+min+" "+Math.ceil((minA-min)*60);
};
return `${toDMS(LAT)} ${LAT>=0?"N":"S"} / ${toDMS(LNG)} ${LNG>=0?"E":"W"}`;
}

// examples
console.log(toDMS( 22.22222, 11.11111));
console.log(toDMS( -22.22222, -11.11111));

Another format would be like this:

function toDMS(LAT,LNG) {
const toDMS=coord=>{min=~~(minA=((a=Math.abs(coord))-(deg=~~a))*60);
return deg+"° "+min+"' "+Math.ceil((minA-min)*60)+'"';
};
return `${LAT>=0?"N":"S"} ${toDMS(LAT)} / ${LNG>=0?"E":"W"} ${toDMS(LNG)}`;
}

// examples
console.log(toDMS( 22.22222, 11.11111));
console.log(toDMS( -22.22222, -11.11111));

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!