laptop and a wrench

Erro

ElementGraphicsLayer cannot be turned off/on using Visible property.

Última Publicação: August 25, 2014 No Product Found
Número de ID do Erro NIM012801
EnviadoNovember 2, 2007
Última ModificaçãoApril 7, 2025
Aplica-se àNo Product Found
Versão encontrada9.2
Idioma do programaC#
StatusWill Not Be Addressed

Informações Adicionais

No Public Explanation

Solução Provisória

Rex suggested the following workaroundsThis is appears to be a bug with ElementGraphicsLayer… I would log it when you get the chance. There are three workarounds at the moment.. all are listed below with some example code. 1) If you need to use an ElementGraphicsLayer, set the SelectedRenderer on each GeometryElement to use a transparent symbol. Then change the value in the IS_SELECTED column to true (not visible) or false (visible). ESRI.ArcGIS.ADF.Web.Display.Symbol.SimpleFillSymbol simpleFillSymbol1 = new ESRI.ArcGIS.ADF.Web.Display.Symbol.SimpleFillSymbol(); simpleFillSymbol1.Color = System.Drawing.Color.Transparent; simpleFillSymbol1.BoundaryWidth = 0; graphicElement.SelectedSymbol = simpleFillSymbol1; DataRow dataRow = elementGraphicsLayer.Add(graphicElement); dataRow["IS_SELECTED"] = false;2) Set the visibility for the map resource item associated with the graphics map resource Map1.MapResourceManagerInstance.ResourceItems.Find(adfGraphicsMapFunctionality.Resource).DisplaySettings.Visible = false;3) Create a FeatureGraphicsLayer and change its visibility via the Visible property. public void AddGraphicData() { ESRI.ArcGIS.ADF.Web.DataSources.Graphics.MapFunctionality adfGraphicsMapFunctionality = null; foreach (ESRI.ArcGIS.ADF.Web.DataSources.IMapFunctionality mapFunctionality in Map1.GetFunctionalities()) { // If multiple graphics resources are available, use the resource name to distinguish if (mapFunctionality.Resource.Name == "ADFGraphicsResource") { adfGraphicsMapFunctionality = mapFunctionality as ESRI.ArcGIS.ADF.Web.DataSources.Graphics.MapFunctionality; break; } } if (adfGraphicsMapFunctionality == null) return; // Add a new ElementGraphicsLayer ESRI.ArcGIS.ADF.Web.Display.Graphics.ElementGraphicsLayer elementGraphicsLayer = new ESRI.ArcGIS.ADF.Web.Display.Graphics.ElementGraphicsLayer(); elementGraphicsLayer.TableName = "Element Graphics - Extent Rectangle"; // Add graphics layer to map functionality graphics dataset ESRI.ArcGIS.ADF.Web.Display.Graphics.GraphicsDataSet graphicsDataSet = adfGraphicsMapFunctionality.GraphicsDataSet; graphicsDataSet.Tables.Add(elementGraphicsLayer); ESRI.ArcGIS.ADF.Web.Geometry.Polygon adfPolygon = new ESRI.ArcGIS.ADF.Web.Geometry.Polygon(); adfPolygon.Rings.Add(new ESRI.ArcGIS.ADF.Web.Geometry.Ring (new ESRI.ArcGIS.ADF.Web.Geometry.Envelope(-100, 20, -80, 40))); ESRI.ArcGIS.ADF.Web.Display.Symbol.SimpleFillSymbol simpleFillSymbol = new ESRI.ArcGIS.ADF.Web.Display.Symbol.SimpleFillSymbol(); simpleFillSymbol.Transparency = 0; simpleFillSymbol.FillType = ESRI.ArcGIS.ADF.Web.Display.Symbol.PolygonFillType.FDiagonal; simpleFillSymbol.BoundaryColor = System.Drawing.Color.Red; ESRI.ArcGIS.ADF.Web.Display.Graphics.GraphicElement graphicElement = new ESRI.ArcGIS.ADF.Web.Display.Graphics.GraphicElement(adfPolygon, simpleFillSymbol); elementGraphicsLayer.Add(graphicElement); elementGraphicsLayer.Visible = false; // Add a new FeatureGraphicsLayer ESRI.ArcGIS.ADF.Web.Display.Graphics.FeatureGraphicsLayer featureGraphicsLayer = new ESRI.ArcGIS.ADF.Web.Display.Graphics.FeatureGraphicsLayer(); featureGraphicsLayer.TableName = "Feature Graphics - Extent Rectangle"; // Add graphics layer to map functionality graphics dataset graphicsDataSet.Tables.Add(featureGraphicsLayer); ESRI.ArcGIS.ADF.Web.Geometry.Polygon adfPolygon2 = new ESRI.ArcGIS.ADF.Web.Geometry.Polygon(); adfPolygon2.Rings.Add(new ESRI.ArcGIS.ADF.Web.Geometry.Ring (new ESRI.ArcGIS.ADF.Web.Geometry.Envelope(-70, 20, -50, 40))); ESRI.ArcGIS.ADF.Web.Display.Renderer.SimpleRenderer simpleRenderer = new ESRI.ArcGIS.ADF.Web.Display.Renderer.SimpleRenderer(); simpleRenderer.Symbol = simpleFillSymbol; featureGraphicsLayer.Renderer = simpleRenderer; featureGraphicsLayer.Add(adfPolygon2); }

Etapas para Reproduzir

ID do Erro: NIM012801

Software:

  • No Product Found

Seja notificado quando o status de um erro mudar

Baixe o Aplicativo de Suporte da Esri

Descubra mais sobre este tema

Obtenha ajuda de especialistas do ArcGIS

Entre em contato com Suporte Técnico

Baixe o Aplicativo de Suporte da Esri

Ir para as opções de download