In that case I think I'm clearly doing something daft! I am using the AddShapeFileAndRasterData example project, and I have set the ShowLabels property of the LayerDrawingOptions class, to no avail. I have also looked at the silverlight example and tried Creating LabelClass (and LabelOption) instances in the code and assigning to the LayerDrawingOptions, but nothing seems to make any difference.p
Essentially I've modified the LocalDynamicMapServiceLayer Initialized event handler like this:
LabelClassCollection labelCollection = new LabelClassCollection();
System.Windows.Media.FontFamily fontFam = new System.Windows.Media.FontFamily("Arial");
LabelClass labelClass = new LabelClass()
{
LabelPlacement = LabelPlacement.PointLabelPlacementAboveRight,
LabelOptions = new LabelOptions() { Color = Colors.Blue, FontSize = 20, FontWeight = FontWeights.Bold, FontStyle = TextStyle.Normal, FontFamily = fontFam },
};
labelCollection.Add(labelClass);
// Create a new LayerDrawingOptions object to hold the renderer information.
var layerDrawOpt = new LayerDrawingOptions()
{
// Match up the LayerID to the ID of the layer within the service.
LayerID = counter,
// Provide a renderer. In this example it is an empty SimpleMarkerSymbol.
Renderer = new SimpleRenderer() { Symbol = new SimpleMarkerSymbol() { } },
ShowLabels = true,
ScaleSymbols = true,
LabelClasses = labelCollection,
};
Everything else is as per the AddShapeFileAndRasterData example. Based on your help so far and the silverlight example, I cannot see why this wouldn't work. I'm going to pull the silverlight example into a debugger and mess around to see if I can get any clues, but any insight you have would be, as always, very welcome.