如何解决Folium/Leaflet:无法在代理后面显示某些图块
我正在使用 pyqt5 创建一个工具来在 QWebEngineView 上显示地图。我几乎可以在没有代理的机器上正确显示我需要的每个图块的地图。在另一台机器上(在代理后面),我只能显示 folium 文档中显示的图块(例如“cartodbpositron”、“stamenterrain”等),但不能显示以下格式的图块。
import folium
map = folium.Map(location = LatLon,tiles=None,zoom_start=15,maxZoom = 19,scroll_wheel_zoom = True,control_scale = True)
folium.raster_layers.TileLayer(tiles = 'https://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}',attr = 'Tiles © Esri — Source: Esri,DeLorme,NAVTEQ,USGS,Intermap,iPC,NRCAN,Esri Japan,METI,Esri China (Hong Kong),Esri (Thailand),TomTom,2012',name = 'Esri World Street Map',max_zoom=19).add_to(map)
为了完整起见,在创建地图后,我执行以下操作:
data = io.BytesIO()
map.save(data,close_file=False)
code = data.getvalue().decode()
new = code.split(sep= '#export')[0][:-36] + ex_style + '</head>' + code.split(sep= '</head>')[1] #Here I just changed the style of the export button
self.Page.setHtml(new) #Connected to the signal proxyauthenticationrequired I set the auth function
self.view.setPage(self.Page)
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。