From 9496d20e21baa14920bc21b081bc7e3c53c5dc2e Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Sun, 17 Sep 2017 14:35:02 +0200 Subject: [PATCH] fixed map view if no coordinates bug --- rowers/interactiveplots.py | 2 +- rowers/templates/map_view.html | 5 ++--- rowers/views.py | 4 ++++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/rowers/interactiveplots.py b/rowers/interactiveplots.py index bcf1aac4..a10c5763 100644 --- a/rowers/interactiveplots.py +++ b/rowers/interactiveplots.py @@ -890,7 +890,7 @@ def leaflet_chart2(lat,lon,name=""): ) div = """ -

 

+

 

""" diff --git a/rowers/templates/map_view.html b/rowers/templates/map_view.html index 1ac95005..08faca97 100644 --- a/rowers/templates/map_view.html +++ b/rowers/templates/map_view.html @@ -29,14 +29,13 @@
-

Map View

{% if user.is_authenticated and mayedit %}
@@ -52,7 +51,7 @@
{% endif %}
-
+
{{ mapdiv|safe }} diff --git a/rowers/views.py b/rowers/views.py index 3a659a1a..20d7b897 100644 --- a/rowers/views.py +++ b/rowers/views.py @@ -6439,6 +6439,10 @@ def workout_map_view(request,id=0): mapscript,mapdiv = leaflet_chart2(rowdata.df[' latitude'], rowdata.df[' longitude'], row.name) + else: + mapscript = "" + mapdiv = "" + mayedit=0 if not request.user.is_anonymous(): r = getrower(request.user)