I was going through the below article on getting geolocation(lat,long) in Windows-10:
Powershell: Getting GPS Coordinates in Windows 10 - Using Windows Location API?
The code mentioned in the answer by user colsw
works like a charm in my personal laptop and gives near perfect lat,long values, however doesn't give any result when i run it in virtual desktop connected to internet on my office laptop (the base machine whcih also gives lat,long value using the same script). It just hangs and gives no error message, so that I can at least debug it.
The Microsoft documentation for System.Device.Location.GeoCoordinateWatcher
class is extremely poor and just gives some code examples on how to implement in c++.
What I need to know is how does it work and pull the lat,long value. I know the basic that it picks up the best method of the following, whichever gives the best value :
- IP Address translation
- WIFI/Internet Access Point
- Cell Phone Tower(if its data is used as Internet Access Point)
- GPS
But I want to know the internal intricacies of how these methods translate to lat,long value, and how does the mentioned class picks up the best method ?
Please help.