working with explanation
This commit is contained in:
@@ -2225,21 +2225,25 @@ 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.bindPopup("<b>{label}</b>",{{ autoPan: false, autoClose: false }}).openPopup()
|
||||||
polyline.on('mouseover',function(ev) {{
|
polyline.on('mouseover',function(ev) {{
|
||||||
ev.target.openPopup();
|
ev.target.openPopup();
|
||||||
}});
|
}});
|
||||||
|
polyline.on('dblclick', function (e) {{
|
||||||
|
mymap.removeLayer(this);
|
||||||
|
}});
|
||||||
mymap.fitBounds(polyline.getBounds())
|
mymap.fitBounds(polyline.getBounds())
|
||||||
""".format(
|
""".format(
|
||||||
scoordinates=scoordinates,
|
scoordinates=scoordinates,
|
||||||
color=color,
|
color=color,
|
||||||
label=label
|
label=label,
|
||||||
|
id=id,
|
||||||
)
|
)
|
||||||
|
|
||||||
script += """
|
script += """
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,9 @@
|
|||||||
Bokeh.set_log_level("info");
|
Bokeh.set_log_level("info");
|
||||||
</script>
|
</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>
|
<p>
|
||||||
<a href="/rowers/virtualevent/{{ race.id }}/compare"
|
<a href="/rowers/virtualevent/{{ race.id }}/compare"
|
||||||
title="Compare the workouts of all competitors">Compare Results</a>
|
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>
|
</p>
|
||||||
{% if race.manager == request.user %}
|
{% if race.manager == request.user %}
|
||||||
<a href="/rowers/virtualevent/{{ race.id }}/download"
|
<a href="/rowers/virtualevent/{{ race.id }}/download"
|
||||||
|
|||||||
Reference in New Issue
Block a user