API for GPS tracking of miles RRS feed

  • Question

  • I have searched Google to find API's for tracking miles driven; like my Garmin does. When I search for the answer, I have page after page of ads for apps available. None of them meet my specific needs.  What I want to know is how many miles I have driven.  Click a button to start, then click the button when I arrive at my destination.  I plan to write in C#, then port to my iPhone. 


    Wednesday, July 4, 2018 12:40 PM

All replies

  • Hi C Jolly,

    Thank you for posting here.

    For your question, try to use Bing map to get the distance.

    For more details, please refer to the similar thread link below.


    Best Regards,


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, July 5, 2018 8:31 AM
  • Hi Wendy,thanks for your response.  I am really looking for an api that uses the iPhone to get actual miles driven.  The map api will not work since while I am driving, I might hit a detour, or I might have to go off route to pick up another package.  I am looking for actual miles.


    Thursday, July 5, 2018 11:31 AM
  • That's not an easy task.  The best you can do is grab samples periodically (you'll have to decide how often), then compute the distance between those points using a mapping API and add up the distances.

    Tim Roberts | Driver MVP Emeritus | Providenza & Boekelheide, Inc.

    Thursday, July 5, 2018 9:33 PM
  • Thanks for answering me, Tim.  Then my question becomes, how does my Garmin do it (if you can answer it).  My Garmin shows miles traveled and miles remaing.  This is what I am looking for.


    Thursday, July 5, 2018 9:48 PM
  • It does exactly what I said.  It samples the GPS readings periodically, computes straight line distances between consecutive samples, and adds them up.  There's nothing else you can do.  A GPS reading is a just a single point in time.

    "Miles remaining" is way more difficult, because you have to sketch out the predicted route, and that requires sophisticated mapping software.

    Tim Roberts | Driver MVP Emeritus | Providenza & Boekelheide, Inc.

    Friday, July 6, 2018 7:02 PM