Private
Public Access
1
0

working pop up

This commit is contained in:
Sander Roosendaal
2020-06-02 22:13:41 +02:00
parent bf8666a988
commit 326aed8f7d

View File

@@ -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 += """