使用下面的代码,我尝试将文本添加到下面的folium FastMarkerCluster markers.The代码中,生成了一个地图,但没有成功添加文本。文本被包含为对应于每个lon lat对的字符串。
我认为这个问题与包含text列的df是一个pandas序列对象有关。据我所知,在这种情况下应该如何指定‘df.column should’。然而,这并不管用。我还尝试过将该列转换为列表,但这种方法也没有成功。任何指导者都非常感谢。
xlat = guns2013['latitude'].tolist()
xlon = guns2013['longitude'].tolist()
locations = list(zip(xlat, xlon))
map2 = folium.Map(location=[38.9, -77.05], tiles='CartoDB dark_matter',
zoom_start=1)
marker_cluster = MarkerCluster().add_to(map2)
for point in range(0, len(locations)):
folium.Marker(locations[point],
popup='guns2013.texts'[point]).add_to(marker_cluster)
map2
https://stackoverflow.com/questions/50661316
复制相似问题