使用folium将文件夹链接添加到python geocoder中

问题描述

我想使用单个地理文件扫描存档数据(列出的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”功能

解决方法

已解决:

Path:                  /Applications/Xcode.app/Contents/MacOS/Xcode
Identifier:            com.apple.dt.Xcode
Version:               11.7 (16142)
Build Info:            IDEFrameworks-16142000000000000~5 (11E801a)
App Item ID:           497799835
App External ID:       837417466
Code Type:             X86-64 (Native)
Parent Process:        ??? [1]
Responsible:           Xcode [47737]
User ID:               503

Date/Time:             2020-09-18 11:06:26.252 -0500
OS Version:            Mac OS X 10.15.4 (19E287)
Report Version:        12
Anonymous UUID:        79A51667-E346-704F-A7E9-60A204A762E4

Sleep/Wake UUID:       58021CB1-DFF8-46F0-97C3-AF609DBF11C5

Time Awake Since Boot: 170000 seconds
Time Since Wake:       11000 seconds

System Integrity Protection: enabled

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_CRASH (SIGABRT)
Exception Codes:       0x0000000000000000,0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Application Specific Information:
ProductBuildVersion: 11E801a
ASSERTION FAILURE in /Library/Caches/com.apple.xbs/Sources/IDEFrameworks/IDEFrameworks-16142/IDEKit/Behaviors/Alerts/ShowEditorAlert/IDEShowEditorAlert.m:143
Details:  Assertion failed: [editorArea _canAddEditorAreaSplitAfterEditorAreaSplit:lastActiveEditorAreaSplit layout:IDEEditorMultipleSplitRelativeLayout_Default]
Object:   <IDEShowEditorAlert>
Method:   +_createEditorAreaSplitForEditorArea:lastActiveEditorAreaSplit:
Thread:   <NSThread: 0x7fd6b4c060e0>{number = 1,name = main}
Open FDs: 57/9472

感谢post