如何处理叶片中的事件?

时间:2018-12-07 06:59:52

标签: python leaflet folium

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

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')

0 个答案:

没有答案