Python叶图开发

Python叶图开发,python,maps,folium,Python,Maps,Folium,我正在尝试在python上构建一个映射,我正在使用folium库。我可以在我的浏览器上看到映射,但它只有: import folium map = folium.Map(location=[25.747608, 89.268044]) map.save("Map2.html") 当我再添加两个参数(tiles=“Mapbox Bright”)和(zoom_start=6)时,我的代码如下所示,但贴图不起作用: import folium map = folium.Map(l

我正在尝试在python上构建一个映射,我正在使用folium库。我可以在我的浏览器上看到映射,但它只有:

import folium
map = folium.Map(location=[25.747608, 89.268044])
map.save("Map2.html")
当我再添加两个参数(tiles=“Mapbox Bright”)和(zoom_start=6)时,我的代码如下所示,但贴图不起作用:

import folium
map = folium.Map(location=[25.747608, 89.268044], zoom_start=6, tiles="Mapbox Bright")
map.save("Map2.html")
    

我可以用我的代码做些什么,以便在浏览器中查看地图我也尝试过,Mapbox Bright或Mapbox Control Room瓷砖似乎都不起作用,我认为它们不再受支持。尝试任何其他平铺,或者不指定平铺参数,它应该可以正常工作

以下是可用瓷砖的列表:

要在浏览器中查看地图,必须添加API_键。或者您可以使用其他瓷砖,如“雄蕊调色剂”、“OpenStreetMap”、“雄蕊调色剂”、“雄蕊水彩”。

您可以在地图中使用HTML,以便在地图中添加任何文本

    legend_html =   '''
                    <div style="position: fixed; 
                bottom: 50px; right: 50px; width: 150px; height: 90px; 
                border:2px solid grey; z-index:9999; font-size:14px;
                ">&nbsp; Legend <br>
                &nbsp; Origin &nbsp; <i class="fa fa-map-marker fa-2x" style="color:green"></i><br>
                &nbsp; Destination &nbsp; <i class="fa fa-map-marker fa-2x" style="color:blue"></i>
                    </div>
                '''

map_m.get_root().html.add_child(folium.Element(legend_html))
legend_html=''
图例
来源
目的地 ''' map_m.get_root().html.add_子元素(folium.Element(legend_html))
我必须检查它们,如何添加Api_键?我使用python创建了地图。我不确定我可以把这段代码放在哪里。这个例子也是用python编写的,例如,图例的html部分是html语句,