Private
Public Access
1
0

working with explanation

This commit is contained in:
Sander Roosendaal
2020-06-03 14:03:40 +02:00
parent 3ab0e13c15
commit 7ac7dbe422
3 changed files with 14 additions and 4 deletions

View File

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