Estoy tratando de agregar simple leyenda al mapa.
Escribí algunos código de prueba simple para ver lo que sucede pero no funcionó.
var map = activeView.FocusMap;
IGraphicsContainer graphicsContainer = activeView.GraphicsContainer;
IMapFrame mapFrame = graphicsContainer.FindFrame(map) as IMapFrame;
UID uid = new UID();
uid.Value = "esriCarto.Legend";
IMapSurround mapSurround = map.CreateMapSurround(uid, null);
mapFrame.CreateSurroundFrame(uid, null);
var legend = (ILegend)mapSurround;
var legendItem = new VerticalLegendItemClass();
legendItem.HeadingSymbol.Text = "served";
legend.AddItem(legendItem);
var legendItema = new VerticalLegendItemClass();
legendItema.HeadingSymbol.Text = "unserved";
legend.AddItem(legendItema);
IElement element = legend as IElement;
element.Geometry = envelope as IGeometry;
graphicsContainer.AddElement(element, 0);
activeView.Refresh();
La leyenda que busco debe ser similar a esto:
¿Alguien tiene alguna enlace o Consejo que podría ayudarme a conseguirlo, por favor?