我在VB6中使用AsyncRead方法(UserControl.AsyncRead Path,FileType,Key,DownloadType)从Internet下载文件。
,当互联网发生故障时,除了AsyncReadProgress外,一切正常。AsyncReadProgress事件一直有效,因为我可以获得AsyncProp.StatusCode。但是当网络出现故障时,AsucnReadProgress事件将不会触发。
L.TileLayer.include({
_tileOnError: function (done, tile, e) {
// Do your stuff
alert('whooops!');
// Leaflet stuff
var errorUrl = this.options.errorTileUrl;
if (errorUrl) {
tile.src = errorUrl;
}
done(e, tile);
}
});