0

I'm writing a program on WatchKit SDK. My aim is to generate a route between user's current location and another point. And I would like to catch a moment when the user should turn the corner. At the moment I wonder, what is a proper framework to use because in fact I do not need to display the map but do need to be able to build the route and catch the turns. Could you advice the proper way to do it?

  • Are you referring to turning on a specific corner (i.e. when they turn right at 5th and Broadway) or anytime they turn and go in a different direction, even if that happens to be in the middle of a field? – Stephen Johnson Feb 03 '15 at 21:25
  • Not with Watchkit specifically - no dev access yet to accelerometer or location on the watch itself. You'd have to get this info from the paired iPhone instead, which you could probably do by setting route w/geofencing & following advice in similar questions like this about MapKit & CLHeading: http://stackoverflow.com/questions/10264137/ios-iphone-show-user-direction-and-orientation-in-space-like-the-compass-app-on – mc01 Feb 03 '15 at 21:28
  • Do you know the GPS coordinates of that corner? – Stephen Johnson Feb 03 '15 at 21:28
  • Sorry, maybe I have confused you. I mean that every time the user should turn left or right when he is on a road I would like to catch it (not in the middle of the field). – Федор Патутинский Feb 03 '15 at 21:33

1 Answers1

1

If I understand your question correctly, you will need to track the users GPS coordinate in your WatchKit extension running on their iPhone. You will need to use the course and coordinate properties on the CLLocation object to determine when you are getting close or at the correct corner and then respond accordingly.

Here is some more info on tracking GPS coordinates in a WatchKit extension How to calculate current location in WatchKit extension

Community
  • 1
  • 1
Stephen Johnson
  • 5,293
  • 1
  • 23
  • 37