【问题标题】:How do I set a destination location for Glass?如何为 Glass 设置目标位置?
【发布时间】:2013-11-06 01:26:48
【问题描述】:

我能够很好地获取我当前的位置。我创建了一张带有行车路线的地图,然后我想让我的用户导航到他们的目的地。

如何设置用户导航的位置?我看不到设置位置的方法,只有 location.list() 和 location.get() 方法。我正在使用 Python,下面是我尝试的代码:

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()

【问题讨论】:

    标签: python python-2.7 google-mirror-api google-glass


    【解决方案1】:

    NAVIGATE 菜单命令将使用的目标位置在location 字段中设置。 Glass 可以自行判断当前位置。

    详情请见https://developers.google.com/glass/v1/reference/timeline

    【讨论】:

    • 知道了! 'location': { "kind": "mirror#location", "id": 'home', "latitude": lat2, "longitude": lng2, "displayName": 'Home'},
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-05-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-05-14
    • 1970-01-01
    相关资源
    最近更新 更多