2

I am able to get my current location just fine. I create a map with driving directions and then I want to allow my user to navigate to their destination.

How do I set the location for the user to navigate? I do not see a way to set location, there are only location.list() and location.get() methods. I am using Python, below is my attempted code:

work = [lat1, lng1]
#home_location = self.mirror_service.locations().set(home)
body = {
    'location': location,
    'html': PAGINATED_HTML % 
    (lat1, lng1, route(home,work), lat1, lng1, distance(home, work)),
    'notification': {'level': 'DEFAULT'},
    'menuItems': [{'action': 'NAVIGATE'},
        {'action': 'READ_ALOUD'},
        {'action': 'DELETE'}],
    'notification': {'level': 'DEFAULT'}

}
# self.mirror_service is initialized in util.auth_required.
self.mirror_service.timeline().insert(body=body).execute()
Jon Clements
  • 138,671
  • 33
  • 247
  • 280
marty331
  • 423
  • 5
  • 12

1 Answers1

3

The destination location which will be used by the NAVIGATE menu command is set in the location field. Glass can figure out the current location by itself.

See https://developers.google.com/glass/v1/reference/timeline for details.

Prisoner
  • 49,922
  • 7
  • 53
  • 105
  • Got it! 'location': { "kind": "mirror#location", "id": 'home', "latitude": lat2, "longitude": lng2, "displayName": 'Home'}, – marty331 Nov 06 '13 at 02:24