Error displays when changing the MapResourceManager dynamically.
上次发布: August 25, 2014No Product Found
漏洞 ID 编号
NIM012578
已提交
October 24, 2007
上次修改时间
June 5, 2024
适用范围
No Product Found
找到的版本
9.2
编程语言
C#
状态
Will Not Be Addressed
开发团队已考虑过该问题或请求,并决定不会解决该问题。 问题的“其他信息”部分可能包含进一步说明。
附加信息
No Public Explanation
解决办法
1)Change the "ImageBlendingMode" property of the map control to "WebTier" and remove the “GraphicsLayer” resource from the MapResourceManager2. The MapResourceManager2 should contain only one resource Item. However after changing to MapResourceManager2 you will still encounter the problem of the cache levels from Europe preventing the Continent map from being zoomed out to view the continent map.2)The following code works well. It not only takes care of more than 1 resourceitem in MapResourceManager2 but also avoid setting the ImageBlendingMode property to “webtier”. In addition the cache levels from Mapresourcemanager1 does not lock the map scale.private void swapResourceItems(MapResourceManager mrm1, MapResourceManager mrm2) { // make a copy of the resource items in mrm1 and mrm2 MapResourceItem[] mriArray = new MapResourceItem[mrm1.ResourceItems.Count]; mrm1.ResourceItems.CopyTo(mriArray, 0); MapResourceItem[] mriArray2 = new MapResourceItem[mrm2.ResourceItems.Count]; mrm2.ResourceItems.CopyTo(mriArray2, 0); // copy the items from mrm2 to mrm1, then remove mrm1's current items // (must add items first; if no items remain, removing the last one causes // an exception when the disposal of the resource item is attempted) MapResourceItem mriTemp; foreach (MapResourceItem mri in mrm2.ResourceItems) { mrm1.ResourceItems.Add(mri); } // Note: use .Remove, not .RemoveAt (RemoveAt does not call the OnResourceItemRemoved // event; that event adds a callback result that tells the browser to remove // the resource--without it, get an error when re-add the old resource name) for (int i = 0; i < mriArray.Length; i++) mrm1.ResourceItems.Remove(mriArray[i]); // copy the items from the temporary collection to mrm2, using the // same method as for mrm1 foreach (MapResourceItem mri in mriArray) mrm2.ResourceItems.Add(mri); for (int i = 0; i < mriArray2.Length; i++) mrm2.ResourceItems.Remove(mriArray2[i]); }