#############
#暂时不需要csv 表格即可运行
#
#########
import numpy as np
import folium
from folium import plugins
import webbrowser
def PlotLineOnMap():
# 给出的坐标系为GCJ-02,如果需要测试google地图,需要进行坐标转换
Lat = [36.648607, 36.658436,36.66844]
Lon = [117.04667,117.126518,117.040105]
#tri = np.array(list(zip(Lat, Lon)))
san_map = folium.Map(
location=[36.648607, 117.04667],
zoom_start=16,
# 高德街道图
tiles='http://webrd02.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=7&x={x}&y={y}&z={z}',
# tiles='http://webst02.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}', # 高德卫星图
attr='default')
#folium.PolyLine(tri, color='#3388ff').add_to(san_map)
marker_cluster = plugins.MarkerCluster().add_to(san_map)
folium.Marker([Lat[0], Lon[0]], color='red').add_to(marker_cluster)
folium.Marker([Lat[1], Lon[1]], color='red').add_to(marker_cluster)
san_map.save('test.html')
def main():
PlotLineOnMap()
if __name__ == '__main__':
main()
webbrowser.open('test.html')
用list中的经纬度在地图上画点
最新推荐文章于 2023-08-03 09:58:32 发布
7591

被折叠的 条评论
为什么被折叠?



