ThinkGeo.com    |     Documentation    |     Premium Support

UI.Wpf freeze in ThinkGeo.Core.TileView.OnApplyTemplate()

Hi

I had an issue in version beta091 (no idea if it persists in other beta versions), but the UI freezes when applying the template on the Map, here is where I stuck according to the Visual Studio debugger:

The code is:

if (canvas == null)
{
	return;
}
FontFamily fontFamily = new FontFamily("Arial");
double fontSize = 13.0;
Brush foreground = new SolidColorBrush(Color.FromArgb(80, byte.MaxValue, 0, 0));
canvas.Children.Clear();
Random random = new Random(DateTime.Now.Millisecond);
for (int i = 0; (double)i < canvasHeight; i += 256)
{
	for (int j = 0; (double)j < canvasWidth; j += 256)
	{
		double length = random.Next(j, j + 128);
		double length2 = random.Next(i, i + 128);
		TextBlock textBlock = new TextBlock();
		textBlock.Width = 200.0;
		textBlock.TextWrapping = TextWrapping.Wrap;
		textBlock.Foreground = foreground;
		textBlock.Text = message;
		textBlock.FontFamily = fontFamily;
		textBlock.FontSize = fontSize;
		canvas.Children.Add(textBlock);
		Canvas.SetLeft(textBlock, length);
		Canvas.SetTop(textBlock, length2);
	}
}

Hi Mahdi,

We couldn’t recreate it but we fixed it by removing that method, which is for rendering eval watermark when initializing the tiles. Please pull beta094 and have a try.

Thanks,
Ben