Hi,
I am doing something very similar to the code in diplay a particular country map but I want to display a label on what is highlighted.
Here is a snippet of the code I am using:
LabelStyle = TextStyles.CreateSimpleTextStyle("Label", "Arial", 8, DrawingFontStyles.Italic, GeoColor.StandardColors.Black, 3, 3);
...
// Add Hilighted feature layer
InMemoryFeatureLayer hiliteShapeLayer = new InMemoryFeatureLayer();
hiliteShapeLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = thisAreaStyle;
hiliteShapeLayer.ZoomLevelSet.ZoomLevel01.DefaultTextStyle = LabelStyle;
hiliteShapeLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
LayerOverlay dynamicOverlay = new LayerOverlay("HiLighted" + (LayerCount + 1));
dynamicOverlay.Layers.Add("InMemoryFeatureLayer" + LayerCount, hiliteShapeLayer);
dynamicOverlay.IsBaseOverlay = false;
dynamicOverlay.TileType = TileType.SingleTile;
Map1.CustomOverlays.Add(dynamicOverlay);
Collection<string> listOfColumsToReturn = new Collection<string>();
listOfColumsToReturn.Add("IDColumn");
listOfColumsToReturn.Add("Label");
foreach(string strID in ListOfIDs) {
Collection<Feature> features = myBaseLayer.QueryTools.GetFeaturesByColumnValue("IDColumn", strID, listOfColumsToReturn);
listOfFeatures.Add(features);
}
hiliteShapeLayer.InternalFeatures.Clear();
foreach(Collection<Feature> features in listOfFeatures) {
foreach(Feature feature in features) {
if(!hiliteShapeLayer.InternalFeatures.Contains(feature.Id)) hiliteShapeLayer.InternalFeatures.Add(feature.Id, feature);
}
}
((LayerOverlay)Map1.CustomOverlays[LayerCount + 1]).Redraw();
I just can't seem to get the Labels to show. They do show up on myBaseLayer if I apply the text style there, but not on the hiliteShapeLayer. What am I doing wrong?