UWP-059 - UWP Weather - Accessing the GPS Location

Sign in to queue

The Discussion

  • User profile image
    Brent Goodman

    When running this, I was getting exception errors in the "LocationManager.cs" file when it was called. To resolve the issue, I had to open the file "Package.appxmanifest", and then from the "Capabilities" tab, select the "Location" checkbox. Once I ran the application again, this time I was presented with the dialog box asking to allow the application to access my location. No further errors.

  • User profile image
    ToyMaker

    Also worth noting: Geolocation access status always results to "Denied" if the user has disabled location in windows 10 (settings --> privacy --> location), and there seems no way to circumvent it. The user will never see the app's prompt to allow location.

  • User profile image
    IamThePeter

    For me, where i am located, the JSON returned this for the wind:

    "wind":{"speed":6.87,"deg":294.501}

    Since the Wind class had "deg" as an integer, it would fail. I had to change the class to accept a double for deg.

     

  • User profile image
    Ivan

    How can I use an external USB/Bluetooth GPS?

  • User profile image
    kittananj

    From the line of get latitude and longitude are "position.Coordinate.Point.Position.Latitude" and "Position.Coordinate.Point.Position.Longitude", accordingly.

    I tried it, and it works.

Add Your 2 Cents