Product: MapXtreme 2004/2005
Version: 6.0, 6.1, 6.2, 6.5
Platform: Not Platform Related
Category: Labels
Summary:
How to remove duplicate labels from a label layer.
Question:
How to remove duplicate labels from a label layer.
Answer:
C# Code:
MapInfo.Mapping.FeatureLayer fl = this.mapControl1.Map.Layers["USCTY_1k"] as MapInfo.Mapping.FeatureLayer;
MapInfo.Mapping.LabelLayer labelLayer = new MapInfo.Mapping.LabelLayer("CityLabels");
MapInfo.Mapping.LabelSource labelSource = new MapInfo.Mapping.LabelSource(fl.Table);
labelSource.DefaultLabelProperties.Caption = "State";
labelSource.DefaultLabelProperties.Visibility.AllowDuplicates = false;
labelLayer.Sources.Append(labelSource);
this.mapControl1.Map.Layers.Add(labelLayer);
VB.Net Code:
Last Modified: 04/13/2006 02:46:29 PM
|