From 37140a158e4d89ef86ae31aa24c46b335604c94b Mon Sep 17 00:00:00 2001 From: daihaorui Date: Mon, 15 Apr 2024 18:31:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Downtracks/show=5Fmaps?= =?UTF-8?q?=E8=BD=A8=E8=BF=B9=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- owntracks/views.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/owntracks/views.py b/owntracks/views.py index 2bb6e8a5..6c87a2bf 100644 --- a/owntracks/views.py +++ b/owntracks/views.py @@ -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)