如何处理叶中的事件?

2024-09-28 03:12:12 发布

您现在位置:Python中文网/ 问答频道 /正文

如何在单击一个标记时在两个标记之间添加一条线。例如,在下面的代码中,我为班加罗尔和德里创建了两个标记。假设当我点击班加罗尔,应该画一条从班加罗尔到德里的线。如何在叶中完成这项工作?在

import folium as fl

bangalore = [12.9716, 77.5946]
delhi = [28.7041, 77.1025]
m = fl.Map(location = delhi, zoom_start = 4)
fl.CircleMarker(location = bangalore, tooltip = 'Bangalore',radius = 2, fill = True).add_to(m)
fl.CircleMarker(location = delhi, tooltip = 'New Delhi',radius = 2, fill = True).add_to(m)
m.save('map.html')

Tags: to代码标记importaddtruelocationfill

热门问题