Edits to layerdefinitions are not being saved consistently for MapResourceItem.
上次发布: August 25, 2014ArcGIS Server (.NET)
漏洞 ID 编号
NIM039011
已提交
October 2, 2008
上次修改时间
June 5, 2024
适用范围
ArcGIS Server (.NET)
找到的版本
9.3
状态
Will Not Be Addressed
开发团队已考虑过该问题或请求,并决定不会解决该问题。 问题的“其他信息”部分可能包含进一步说明。
附加信息
No Public Explanation
解决办法
Copy and paste the following code snippet in the Page_Load part. Remove everything in the LayerDefinitions column in the MapReourceManager control.=========================================== if (!MapResourceManager1.Initialized) MapResourceManager1.Initialize(); LayerDefinitionCollection layDesCol = (LayerDefinitionCollection)MapResourceManager1.ResourceItems[0].LayerDefinitions; for (int i = 0; i < layDesCol.Nodes.Count; i++) { if (layDesCol.Nodes[i].Text == "States") // here "States" is the layer name, replace with your layer name which you want to customize { LayerDefinition layDef = (LayerDefinition)layDesCol.Nodes[i].Data; layDef.LayerFormat.Fields[3].Visible = false; layDef.LayerFormat.Fields[4].Visible = false; layDef.LayerFormat.Fields[5].Visible = false; MapResourceManager1.ResourceItems[0].UpdateLayerDefinitions(); } }===========================================