ahmed elbarbary

ahmed elbarbary

  • NA
  • 1.6k
  • 253.7k

How to store value of latitude and longtude on two variables

Dec 30 2019 4:35 AM
How to store values of loc[0] and loc[1] on two variables latitude and longtude 
and what type of two variables ?
 
  1. this.partDetailsService.getLocationData(locationArr).subscribe(res => {    
  2.                 console.log(res);  
  3.         res.forEach((item, index) => {  
  4.             let dataLocation = res[index]['_source']['GPS1'];    
  5.             console.log(dataLocation);     
  6.             let loc = dataLocation.split(',');     
  7.             console.log("After");    
  8.             console.log(loc);    success
  9.             console.log(loc[0].trim());   success
  10.             console.log(loc[1].trim());  success
  11.       
  12.              
  13.          });  
latitude= result of loc[0].trim after loop finish
longtude= result of loc[1].trim after loop finish
and what datatype assigned to two variables ?
 
 

Answers (9)