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