protected virtual void GetTile(TileCoordWrap tileWrap)
 {
     try
     {
         string url = _source.GetRequestUrl(tileWrap.Tile);
         Interlocked.Increment(ref _currTileIndex);
         lock (_lastTiles)
         {
             _lastTiles.Enqueue(tileWrap.Tile);//记录最后一次Tile,下次执行时继续。
         }
         using (Stream stream = _tileLoadStrategy.GetTile(url))
         {
             _outputStrategy.Write(stream, _source.GetOutputTile(tileWrap.Tile, _mapConfig.OffsetZoom));
             tileWrap.OnSuccess.Invoke(tileWrap.Tile);
         }
     }
     catch (Exception ex)
     {
         tileWrap.OnFailed.Invoke(tileWrap.Tile, ex);
     }
     finally
     {
         tileWrap.OnFinally.Invoke(tileWrap.Tile);
     }
 }
 private void GetTile(TileCoordWrap tileWrap)
 {
     try
     {
         Interlocked.Increment(ref _currTileIndex);
         using (Stream stream = _source.GetTile(tileWrap.Tile))
         {
             string filePath = _tilePathBuilder.BuildTilePath(tileWrap.Tile);
             using (FileStream fs = new FileStream(filePath, FileMode.OpenOrCreate, FileAccess.ReadWrite))
             {
                 byte[] buffer = new byte[8192];//8K
                 int    ret    = stream.Read(buffer, 0, buffer.Length);
                 while (ret > 0)
                 {
                     fs.Write(buffer, 0, ret);
                     ret = stream.Read(buffer, 0, buffer.Length);
                 }
                 tileWrap.OnSuccess?.Invoke();
                 OnTileLoaded(tileWrap.Tile);
             }
         }
     }
     catch (Exception ex)
     {
         tileWrap.OnFailed.Invoke(tileWrap.Tile, ex);
     }
     finally
     {
         tileWrap.OnFinally.Invoke(tileWrap.Tile);
     }
 }