fixed
This commit is contained in:
@@ -2075,19 +2075,14 @@ def leaflet_chart_compare(course,workoutids,labeldict={},startenddict={}):
|
|||||||
'lon':rowdata.df[' longitude'],
|
'lon':rowdata.df[' longitude'],
|
||||||
'time':time-time[0],
|
'time':time-time[0],
|
||||||
})
|
})
|
||||||
|
data.append(df)
|
||||||
except Workout.DoesNotExist:
|
except Workout.DoesNotExist:
|
||||||
df = pd.DataFrame({
|
pass
|
||||||
'workoutid':id,
|
|
||||||
'lat':[],
|
|
||||||
'lon':[]}
|
|
||||||
)
|
|
||||||
|
|
||||||
data.append(df)
|
|
||||||
|
|
||||||
|
|
||||||
df = pd.concat(data,axis=0)
|
df = pd.concat(data,axis=0)
|
||||||
|
|
||||||
|
|
||||||
latmean,lonmean,coordinates = course_coord_center(course)
|
latmean,lonmean,coordinates = course_coord_center(course)
|
||||||
lat_min, lat_max, long_min, long_max = course_coord_maxmin(course)
|
lat_min, lat_max, long_min, long_max = course_coord_maxmin(course)
|
||||||
|
|
||||||
@@ -2144,7 +2139,6 @@ def leaflet_chart_compare(course,workoutids,labeldict={},startenddict={}):
|
|||||||
df.fillna(method='ffill',axis=0,inplace=True)
|
df.fillna(method='ffill',axis=0,inplace=True)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
lat = df['lat']
|
lat = df['lat']
|
||||||
lon = df['lon']
|
lon = df['lon']
|
||||||
if lat.empty or lon.empty:
|
if lat.empty or lon.empty:
|
||||||
@@ -2284,7 +2278,8 @@ def leaflet_chart_compare(course,workoutids,labeldict={},startenddict={}):
|
|||||||
""".format(x=x,y=y)
|
""".format(x=x,y=y)
|
||||||
scoordinates += "]"
|
scoordinates += "]"
|
||||||
|
|
||||||
script += """
|
if not group.empty:
|
||||||
|
script += """
|
||||||
var latlongs = {scoordinates}
|
var latlongs = {scoordinates}
|
||||||
var polyline = L.polyline(latlongs, {{color:'{color}'}}).addTo(mymap)
|
var polyline = L.polyline(latlongs, {{color:'{color}'}}).addTo(mymap)
|
||||||
polyline.bindPopup("<b>{label}</b>",{{ autoPan: false, autoClose: false }}).openPopup()
|
polyline.bindPopup("<b>{label}</b>",{{ autoPan: false, autoClose: false }}).openPopup()
|
||||||
|
|||||||
Reference in New Issue
Block a user