0

I have tried this and getting my current location but whenever I move cid is changing and the location is not updated. I am using Rest in web application. any suggestions on how to get the live location of my device(in here-maps)?

  "lte": [{
  "mcc": 262,
  "mnc": 2,
  "cid": 2898945,
  "nmr": [
    { "earfcn": 6300, "pci": 237 },
    { "earfcn": 6300, "pci": 442 }
  ]
  }]
}```
HARSHA sss
  • 85
  • 9

1 Answers1

0

You have to listen to CID changes, and every time the value changes, send an HTTP request to the locate endpoint, that is https://pos.ls.hereapi.com/positioning/v1/locate.

In a setup like yours:

On the cellphone, regularly poll for your CID value and compare with the previous one to detect updates.

Then, push the CID updates to your webapp backend, or create one if missing, and have the backend resolve the location with the help of HERE locate endpoint. Finally, have the webapp update in consequence, typically by rendering the location estimate on the map.

Michel
  • 26,600
  • 6
  • 64
  • 69
  • I am taking the details of the sim and keeping them in my js code. how can I Poll my Cid regularly because I can't get the cid information using js. – HARSHA sss Jan 03 '20 at 13:39
  • You wrote: "whenever I move cid is changing". How do you currently get your _cid_ value? – Michel Jan 03 '20 at 14:26
  • If you want to locate your cellphone, then you could query the locate endpoint from your phone. – Michel Jan 03 '20 at 14:31
  • I was watching it on an android application.I want to implement this on a web application with a small device@Michael P.Bazos – HARSHA sss Jan 06 '20 at 13:18
  • Push those CID updates to your webapp backend or create one if missing, and have the backend resolve the location with the help of HERE locate endpoint. Then, have the webapp update in consequence... – Michel Jan 06 '20 at 21:16