我想用单个地理文件扫描存档数据(列出的DIC),并将文件路径作为链接添加到弹出窗口中:
locations_map = Map()
locations_map.add_child(
Marker(location = [47.981300, 7.842700],
icon = folium.Icon(color = 'blue')));
file_dict = [{'file' : '/data/test 6/', 'go' : 'one', 'loc' : '47.981367, 7.842787'},
{'file' : '/data/TEST4a/', 'go' : 'two', 'loc' : '47.981767, 7.842097'}]
for i in pd.Series(file_dict):
name = i['go']
file_dir = i['file']
locations = i['loc'].split(",")
folium.features.RegularPolygonMarker(location = [locations[0], locations[1]],
tooltip = name,
popup = "Name:" + name
+ "Location: " + ("<a href=file_dir>open</a>")
).add_to(locations_map)
要在浏览器中打开,请执行以下操作:
locations_map.save("locations_map.html")
webbrowser.open("locations_map.html", new=2);
输出为/MyMagnumMint/Archive-Mapping/file_dir
,而不是/MyMagnumMint/Archive-Mapping/data/test 6/
和/MyMagnumMint/Archive-Mapping/data/TEST4a/
我尝试使用不同的引号("<a href='file_dir'>open</a>"
)和RegularPolygonMarkers的“https”特性
已解决:
谢谢这个post
相关问题 更多 >
编程相关推荐