ITADN

NetworkError when attempting to fetch resource with add_cog_layer

#1307Closedkeves1 创建于 2026-03-11
bug
K
keves1commented
<!-- Please search existing issues to avoid creating duplicates. --> ### Environment Information - leafmap version: 0.60.1 - Python version: 3.11.13 - Operating System: WSL on Windows 11 ### Description I have a streamlit app that uses `add_cog_layer` with folium. With a previous version of leafmap (0.57.9), this was working, but now it is not. The layer does not render and in the browser logs I see these errors: `Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://github.com/opengeos/data/releases/download/raster/Libya-2023-07-01.tif.ovr. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 404.` `Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://github.com/opengeos/data/releases/download/raster/Libya-2023-07-01.tif. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 302.` `Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://github.com/opengeos/data/releases/download/raster/Libya-2023-07-01.tif. (Reason: CORS request did not succeed). Status code: (null).` `leafmap: failed to load GeoTIFF layer TypeError: NetworkError when attempting to fetch resource. srcdoc:331:29` ### What I Did Here is a minimal example to reproduce this: ``` import leafmap.foliumap as leafmap import streamlit as st class MyApp: def __init__(self): st.set_page_config(layout="wide") def display(self): url = "https://github.com/opengeos/data/releases/download/raster/Libya-2023-07-01.tif" m = leafmap.Map(center=[32.774842775326846, 22.628278391361995], zoom=10) m.add_basemap("HYBRID") m.add_cog_layer(url=url) m.to_streamlit(height=600) if __name__ == "__main__": app = MyApp() app.display() ```
关闭于 2026-03-14 1 条评论