/// <summary> /// Add map labels for fieldAttributes feature layer /// </summary> /// <param name="pFLyr">The feature layer to add labels to</param> /// <param name="pCategoryTitle">The title of the label category (not visible)</param> /// <param name="pLabelExpression">The label expression, mFeatureIndex.e. [fieldname]</param> /// <param name="pFontFamily">The font family</param> /// <param name="pFontSize"></param> /// <param name="pFontColor"></param> /// <param name="pDynVisWidth"></param> /// <param name="pUseDynVis"></param> /// <param name="pDynVisMode"></param> public static void AddLabelsForFeatureLayer( IFeatureLayer pFeatureLayer, string pCategoryTitle, string pLabelExpression, Color pFontColor = default(Color), string pFontFamily = "Arial", int pFontSize = 12, bool pUseDynVis = false, int pDynVisWidth = 2000, DynamicVisibilityMode pDynVisMode = DynamicVisibilityMode.ZoomedIn) { Color pColor = pFontColor.IsEmpty ? Color.Black : pFontColor; var mSymbolizer = GetLabelSymbolizer(pFontFamily, pFontColor, pFontSize); var mLabelCategory = GetLabelCategory(pCategoryTitle, pLabelExpression, mSymbolizer); MapLabelLayer mMapLabelLayer = new MapLabelLayer(pFeatureLayer); pFeatureLayer.LabelLayer = mMapLabelLayer; pFeatureLayer.ShowLabels = true; pFeatureLayer.LabelLayer.Symbology.Categories.Clear(); pFeatureLayer.LabelLayer.Symbology.Categories.Add(mLabelCategory); pFeatureLayer.LabelLayer.UseDynamicVisibility = pUseDynVis; pFeatureLayer.LabelLayer.DynamicVisibilityMode = pDynVisMode; pFeatureLayer.LabelLayer.DynamicVisibilityWidth = pDynVisWidth; pFeatureLayer.LabelLayer.CreateLabels(); return; }
private void btnZoomedIn_Click(object sender, EventArgs e) { _dynamicVisiblityMode = DynamicVisibilityMode.ZoomedIn; this.DialogResult = DialogResult.OK; Close(); }
private void BtnZoomedOutClick(object sender, EventArgs e) { DynamicVisibilityMode = DynamicVisibilityMode.ZoomedOut; DialogResult = DialogResult.OK; Close(); }