python代碼如下:
import webbrowser as wb import folium if __name__ == '__main__': loc = [30.679943, 104.067923] # 成都中心位置經(jīng)緯度 map = folium.Map(location=loc, zoom_start=11, zoom_control=True, tiles='OpenStreetMap') # 默認(rèn)OpenStreetMap s1 = '地理位置標(biāo)記點(diǎn)上的彈出窗口,展示標(biāo)記點(diǎn)數(shù)據(jù)內(nèi)容' s2 = 'zhang phil' s3 = 'https://zhangphil.blog.csdn.net/' WIDTH = max(len(s1.encode('utf-8')), len(s2.encode('utf-8')), len(s3.encode('utf-8'))) pop = folium.Popup(html=folium.Html(""" {}/br> {}/br> {}/br> """.format(s1, s2, s3), script=True, width=WIDTH * 4), parse_html=True, max_width=3000, ) # 添加一個(gè)標(biāo)記,然后設(shè)置彈窗。 folium.Marker( location=loc, popup=pop, tooltip="標(biāo)記點(diǎn)" ).add_to(map) map.save('map.html') wb.open('map.html') # https://nbviewer.jupyter.org/github/python-visualization/folium/blob/master/examples/Popups.ipynb
輸出結(jié)果如圖:
到此這篇關(guān)于Python地理地圖可視化folium標(biāo)記點(diǎn)彈窗設(shè)置代碼(推薦)的文章就介紹到這了,更多相關(guān)Python地圖可視化folium內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
標(biāo)簽:湘西 三亞 呼倫貝爾 銀川 安慶 烏魯木齊 呼倫貝爾 葫蘆島
巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《Python地理地圖可視化folium標(biāo)記點(diǎn)彈窗設(shè)置代碼(推薦)》,本文關(guān)鍵詞 Python,地理,地圖,可視化,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。