private void HandleTileReceived(object sender, TileReceivedEventArgs e) { var i = e.TileInfo.Index; if (i.Level != _level) { return; } //System.Diagnostics.Debug.WriteLine("Tile received (Index({0}, {1}, {2}))", i.Level, i.Row, i.Col); // some timed refreshes if the server becomes slooow... if (_stopwatch.Elapsed.Milliseconds > 250 && !_tileFetcher.Ready()) { _stopwatch.Reset(); MapFrame.Invalidate(); _stopwatch.Restart(); return; } var ext = ToBrutileExtent(MapFrame.ViewExtents); if (ext.Intersects(e.TileInfo.Extent)) { MapFrame.Invalidate(FromBruTileExtent(e.TileInfo.Extent)); } }
private void HandleQueueEmpty(object sender, EventArgs empty) { _stopwatch.Reset(); MapFrame.Invalidate(); }