Skip to content

Commit

Permalink
修复owntracks/show_maps轨迹异常
Browse files Browse the repository at this point in the history
  • Loading branch information
dhr2333 committed Apr 15, 2024
1 parent 147115b commit 37140a1
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions owntracks/views.py
Original file line number Diff line number Diff line change
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 37140a1

Please sign in to comment.