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