locked
Can I use System.Device.Location.GeoCoordinate.GetDistanceTo in WindowsPhone 8.1 SDK? RRS feed

  • Question

  • I want to use the GetDistanceTo method of System.Device.Location.GeoCoordinate.

    I am developing Windows Phone app using 8.1 SDK

    On the msdn page: http://msdn.microsoft.com/en-us/data/system.device.location.geocoordinate.getdistanceto(v=vs.96)

    It is saying that it is supported in Windows Phone 8.1

    But My compiler gives me error when I am trying: 

    using System.Device.Location;
    

    How should I use it correctly?

    Even more in my references I see:

    .Net for Windows Store Apps

    Clicking on which shows System.Devices reference in object browser.

    What Am I doing wrong?

    Thursday, July 17, 2014 3:59 AM

Answers

  • System.Device.Location is used by Silverlight apps and is not available to Runtime apps.

    Runtime apps use the Windows.Devices.Geolocation namespace. Calculating the distance yourself with the Haversine formula is pretty straightforward.


    Thursday, July 17, 2014 5:36 AM