[问题] gmap转html问题

楼主: sutekidesune (喵的~~喵咪)   2020-03-27 00:58:51
这几天我在研究gmap的使用
想在地图上标注地点后产出html结果
使用上没问题,但有个问题一直困扰我
就是不断地执行程式,html档案大小会一直变大
除非把spyder关掉后重开执行的档案大小才会又变小
不晓得版上有人可以指点该如何处理?
谢谢
范例程式码如下:
gmaps.configure(api_key=Api_Key)
plant_locations = [plant['location'] for plant in
nuclear_power_plants2019]
info_box_template = """
<dl>
<dt>Name</dt><dd>{name}</dd>
<dt>Address</dt><dd>{address}</dd>
<dt>Company_Setup_Year</dt><dd>{Company_Setup_Year}</dd>
</dl>
"""
plant_info = [info_box_template.format(**plant) for plant in
nuclear_power_plants2019]
temp_layer = gmaps.marker_layer(plant_locations,
info_box_content=plant_info)
marker_layer = gmaps.symbol_layer(plant_locations,
info_box_content=plant_info, fill_color='red',stroke_color='red', scale=4)
figure_layout = {
'width': '1600px',
'height': '900px',
'border': '1px solid black',
'padding': '1px'
}
fig = gmaps.figure(layout=figure_layout)
fig.add_layer(temp_layer)
fig.add_layer(marker_layer)
embed_minimal_html('ABC.html', views=[fig])

Links booklink

Contact Us: admin [ a t ] ucptt.com