working with explanation
This commit is contained in:
@@ -2225,21 +2225,25 @@ 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.bindPopup("<b>{label}</b>",{{ autoPan: false, autoClose: false }}).openPopup()
|
||||
polyline.on('mouseover',function(ev) {{
|
||||
ev.target.openPopup();
|
||||
}});
|
||||
polyline.on('dblclick', function (e) {{
|
||||
mymap.removeLayer(this);
|
||||
}});
|
||||
mymap.fitBounds(polyline.getBounds())
|
||||
""".format(
|
||||
scoordinates=scoordinates,
|
||||
color=color,
|
||||
label=label
|
||||
label=label,
|
||||
id=id,
|
||||
)
|
||||
|
||||
script += """
|
||||
|
||||
</script>
|
||||
"""
|
||||
"""
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -17,7 +17,9 @@
|
||||
Bokeh.set_log_level("info");
|
||||
</script>
|
||||
|
||||
<h1>Interactive Comparison</h1>
|
||||
<h1>Course Map Comparison</h1>
|
||||
|
||||
<p>Click on a line to see the label. Double click on a line to remove it. Reload to get back all lines.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -377,6 +377,10 @@
|
||||
<p>
|
||||
<a href="/rowers/virtualevent/{{ race.id }}/compare"
|
||||
title="Compare the workouts of all competitors">Compare Results</a>
|
||||
{% if race.sessiontype == 'race' %}
|
||||
<a href="/rowers/virtualevent/{{ race.id }}/mapcompare"
|
||||
title="Compare the courses taken by the competitors">Compare Course</a>
|
||||
{% endif %}
|
||||
</p>
|
||||
{% if race.manager == request.user %}
|
||||
<a href="/rowers/virtualevent/{{ race.id }}/download"
|
||||
|
||||
Reference in New Issue
Block a user