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