[問題] gmap轉html問題

看板Python作者 (喵的~~喵咪)時間5年前 (2020/03/27 00:58), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
這幾天我在研究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]) -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 110.50.189.209 (臺灣) ※ 文章網址: https://www.ptt.cc/bbs/Python/M.1585241933.A.41A.html
文章代碼(AID): #1UVDzDGQ (Python)
文章代碼(AID): #1UVDzDGQ (Python)