laptop and a wrench

Bug

Error displays when changing the MapResourceManager dynamically.

Last Published: August 25, 2014 No Product Found
Bug ID Number NIM012578
SubmittedOctober 24, 2007
Last ModifiedJune 5, 2024
Applies toNo Product Found
Version found9.2
Program languageC#
StatusWill Not Be Addressed

Additional Information

No Public Explanation

Workaround

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

Steps to Reproduce

Bug ID: NIM012578

Software:

  • No Product Found

Get notified when the status of a bug changes

Download the Esri Support App

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options