Hi Neil,
I build a really simple sample with our latest development dlls, it looks everything goes well, please have a try it and see whether that works for you.
using System;
using System.Windows;
using System.Windows.Controls;
using ThinkGeo.MapSuite.Core;
using ThinkGeo.MapSuite.WpfDesktopEdition;
namespace CSHowDoISamples
{
public partial class DisplayASimpleMap : UserControl
{
public DisplayASimpleMap()
{
InitializeComponent();
}
private void WpfMap_Loaded(object sender, RoutedEventArgs e)
{
InMemoryFeatureLayer layer = new InMemoryFeatureLayer();
Feature testFeature = new Feature(0, 0);
testFeature.ColumnValues.Add("label", "It's a label for test!");
layer.InternalFeatures.Add(testFeature);
TextStyle customTextStyle = new TextStyle();
customTextStyle.TextColumnName = "label";
customTextStyle.Font = new GeoFont("Arial", 20, DrawingFontStyles.Bold);
customTextStyle.TextSolidBrush.Color = GetRandomColor();
layer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(PointStyles.Capital1);
layer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(customTextStyle);
layer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
LayerOverlay overlay = new LayerOverlay();
overlay.Layers.Add(layer);
Map1.Overlays.Add("TestOverlay", overlay);
Map1.MapUnit = GeographyUnit.DecimalDegree;
Map1.CurrentExtent = new RectangleShape(-10, 10, 10, -10);
Map1.Refresh();
}
private GeoColor GetRandomColor()
{
Random random = new Random();
int a = random.Next(200, 255);
int r = random.Next(0, 255);
int g = random.Next(0, 255);
int b = random.Next(0, 255);
return new GeoColor(a, r, g, b);
}
private void Button_Click(object sender, RoutedEventArgs e)
{
TextStyle customTextStyle = new TextStyle();
customTextStyle.TextColumnName = "label";
customTextStyle.Font = new GeoFont("Arial", 20, DrawingFontStyles.Bold);
customTextStyle.TextSolidBrush.Color = GetRandomColor();
((Map1.Overlays["TestOverlay"] as LayerOverlay).Layers[0] as InMemoryFeatureLayer).ZoomLevelSet.ZoomLevel01.CustomStyles.Clear();
((Map1.Overlays["TestOverlay"] as LayerOverlay).Layers[0] as InMemoryFeatureLayer).ZoomLevelSet.ZoomLevel01.CustomStyles.Add(customTextStyle);
((Map1.Overlays["TestOverlay"] as LayerOverlay).Layers[0] as InMemoryFeatureLayer).ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
Map1.Refresh();
}
}
}
Wish that’s helpful.
Regards,
Don