Hi @Ben
I played around with this, too. Below is the full code using .NET 4.8 and VS2017.
Everything was fine with Wpf 376 but after upgrading to 377 I either get that ^ behavior or alternatively the “corrupt memory” issue or everything just hangs (task manager says process is taking up to 25% of CPU and not responding).
And all this just by starting to debug the application and changing window size a few times. Resizing horizontally usually makes duplicate adornments while vertically resizing usually ends up with lock and/or corrupt memory.
XAML
<Window x:Class="ThinkGeoWpfSample.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:uc1="clr-namespace:ThinkGeo.UI.Wpf;assembly=ThinkGeo.UI.Wpf"
Title="MainWindow" Height="450" Width="800">
<uc1:MapView
x:Name="mapView"
Loaded="mapView_Loaded"/>
</Window>
Code behind
using System.Windows;
using ThinkGeo.Core;
namespace ThinkGeoWpfSample
{
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private void mapView_Loaded(object sender, RoutedEventArgs e)
{
mapView.MapUnit = GeographyUnit.Meter;
var osmOverlay = new ThinkGeoCloudRasterMapsOverlay(
@"clientId",
@"clientSecret");
osmOverlay.TileCache = new FileRasterTileCache(@"C:\Temp", "ThinkGeo");
mapView.Overlays.Add(osmOverlay);
var scale = new ScaleLineAdornmentLayer
{
UnitSystem = ScaleLineUnitSystem.ImperialAndMetric,
Location = AdornmentLocation.LowerRight,
XOffsetInPixel = -70f,
YOffsetInPixel = -100f
};
scale.TextStyle.Font.Size = 10f;
mapView.AdornmentOverlay.Layers.Add(scale);
mapView.Refresh();
}
}
}
Here’s some screencaps, scalebar is shown four times at the end in both.