ahmed elbarbary

ahmed elbarbary

  • NA
  • 1.6k
  • 251.8k

How to get gps1(lat,lng) values for group of locationId ?

Dec 29 2019 9:42 AM
How to get gps1 for every locations as following :
  1. locationArr=[40871, 60009, 38149, 40868, 43240, 15299, 53897, 40976, 38151, 23183, 38152, 78579, 23180, 40977, 23176, 39565, 40884, 15298, 38147, 40966, 39669]  
every number represent locationId
I need to pass 21 LocationId   to get 21 GPS1 latitude and longtude .
I can get it one for one locationId 
  1. getLocationData(id: number) {  
  2. console.log("server "+id)  
  3. return this.http.get('http://192.168.7.45:9200/location/_doc/'+id);  
  4. }  
 
 
  1. this.partDetailsService.getLocationData(this.LocationId).subscribe(res => {          
  2.          this.dataLocation = res['_source']['GPS1'];     
  3.          var loc = this.dataLocation.split(',');      
  4.          this.lat = loc[0].trim();    
  5.          this.lng = loc[1].trim();  
 But cannot get locationId for 21 location id 
 
so that i need to put code above on for  to array of locationId 
 
How to make loop to get values of GPS1 latitude and longtude to every LocationId from array above
 
meaning i will get GPS1 21 Time .
 
every locationId have GPS1 
 
How to do that please 
 
 i need to replace array of locationId in place of
 
this.locationId 
 

Answers (4)