working pop up
This commit is contained in:
@@ -2197,6 +2197,11 @@ def leaflet_chart_compare(course,workoutids,labeldict={},startenddict={}):
|
||||
startsecond = 0
|
||||
endsecond = 0
|
||||
|
||||
try:
|
||||
label = labeldict[id]
|
||||
except KeyError:
|
||||
label = str(id)
|
||||
|
||||
group.sort_values(by='time',ascending=True,inplace=True)
|
||||
group.dropna(axis=0,how='any',inplace=True)
|
||||
if endsecond > 0:
|
||||
@@ -2220,10 +2225,15 @@ def leaflet_chart_compare(course,workoutids,labeldict={},startenddict={}):
|
||||
script += """
|
||||
var latlongs = {scoordinates}
|
||||
var polyline = L.polyline(latlongs, {{color:'{color}'}}).addTo(mymap)
|
||||
polyline.bindPopup("<b>{label}</b>")
|
||||
polyline.on('mouseover',function(ev) {{
|
||||
ev.target.openPopup();
|
||||
}});
|
||||
mymap.fitBounds(polyline.getBounds())
|
||||
""".format(
|
||||
scoordinates=scoordinates,
|
||||
color=color,
|
||||
label=label
|
||||
)
|
||||
|
||||
script += """
|
||||
|
||||
Reference in New Issue
Block a user