上代碼:
<code>import gmplot #導入模塊,安裝不再贅述 latitude_list = [ 30.3358376, 30.307977, 30.3216419 ] # 緯度列表 longitude_list = [ 77.8701919, 78.048457, 78.0413095 ] #經度列表 gmap3 = gmplot.GoogleMapPlotter(30.3164945, 78.03219179999999, 13) #傳入經度,緯度參數 gmap3.scatter( latitude_list, longitude_list, '# FF0000', size = 40, marker = False ) #傳入經度,緯度的列表參數,繪圖顏色,大小,標記 gmap3.plot(latitude_list, longitude_list, 'cornflowerblue', edge_width = 2.5) gmap3.draw( "C:\\Users\\user\\Desktop\\map13.html" ) #在html網頁中打開顯示出來 /<code>
輸出結果:
嘗試著更換一下經緯度的參數,感受一下界面的地圖圖形變化.
祝學習愉快!