Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
所以我使用flutter_map 包在我的应用程序中包含openstreetmap。如果我的应用程序无法在 10 秒内加载它,我希望我的应用程序跳过地图,以防互联网连接太差。有没有办法知道下载过程是否已经完成?
您可以监听地图上的load事件,它在地图加载时触发加载地图事件或检查 TileLayer 是否加载加载瓦片事件
load
要检查地图load事件,您必须在调用之前添加侦听器setView
setView
var map = L.map('map'); map.on('load', (e)=>console.log(e)); map.setView([0,0]);