laptop and a wrench

不具合

ElementGraphicsLayer cannot be turned off/on using Visible property.

最後に公開された状態: August 25, 2014 No Product Found
不具合 ID 番号 NIM012801
送信されましたNovember 2, 2007
最終更新日April 7, 2025
適用対象No Product Found
見つかったバージョン9.2
プログラム言語C#
ステータスWill Not Be Addressed

参考情報

No Public Explanation

対処法

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); }

再現の手順

不具合 ID: NIM012801

ソフトウェア:

  • No Product Found

バグのステータスが変更されたときに通知を受け取る

Esri Support アプリのダウンロード

このトピックについてさらに調べる

ArcGIS エキスパートのサポートを受ける

テクニカル サポートへのお問い合わせ

Esri Support アプリのダウンロード

ダウンロード オプションに移動