Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/298.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 如何设置玻璃的目标位置?_Python_Python 2.7_Google Mirror Api_Google Glass - Fatal编程技术网

Python 如何设置玻璃的目标位置?

Python 如何设置玻璃的目标位置?,python,python-2.7,google-mirror-api,google-glass,Python,Python 2.7,Google Mirror Api,Google Glass,我可以很好地找到我目前的位置。我创建了一张带有驾驶方向的地图,然后我想让我的用户导航到他们的目的地 如何设置用户导航的位置?我没有看到设置位置的方法,只有location.list()和location.get()方法。我正在使用Python,下面是我尝试的代码: work = [lat1, lng1] #home_location = self.mirror_service.locations().set(home) body = { 'location': location,

我可以很好地找到我目前的位置。我创建了一张带有驾驶方向的地图,然后我想让我的用户导航到他们的目的地

如何设置用户导航的位置?我没有看到设置位置的方法,只有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()

导航菜单命令将使用的目标位置在
location
字段中设置。Glass可以自己确定当前位置


有关详细信息,请参阅。

明白了位置“:{”种类“:”镜像#位置“,”id“:”主页“,”纬度“:”lat2,“经度“:”lng2,“显示名称“:”主页“,”,