Skip to content

Commit

Permalink
Merge pull request #711 from dhr2333/dev
Browse files Browse the repository at this point in the history
修复owntracks/show_maps轨迹异常
  • Loading branch information
liangliangyy committed Apr 19, 2024
2 parents 147115b + 37140a1 commit 25993c4
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions owntracks/views.py
Expand Up @@ -116,10 +116,14 @@ def get_datas(request):
d = dict()
d["name"] = tid
paths = list()
locations = convert_to_amap(
sorted(item, key=lambda x: x.creation_time))
for i in locations.split(';'):
paths.append(i.split(','))
# 使用高德转换后的经纬度
# locations = convert_to_amap(
# sorted(item, key=lambda x: x.creation_time))
# for i in locations.split(';'):
# paths.append(i.split(','))
# 使用GPS原始经纬度
for location in sorted(item, key=lambda x: x.creation_time):
paths.append([str(location.lon), str(location.lat)])
d["path"] = paths
result.append(d)
return JsonResponse(result, safe=False)

0 comments on commit 25993c4

Please sign in to comment.