The visibility of layers in IMapDescription gets corrupted after setting the extent in IMapDescription and calling the applyMapDescription method.
Last Published: February 10, 2015No Product Found
Bug ID Number
NIM006436
Submitted
January 29, 2007
Last Modified
June 5, 2024
Applies to
No Product Found
Version found
9.2
Version Fixed
9.3
Status
Fixed
The bug has been fixed. See the Version Fixed and Additional Information, if applicable, for more information.
Additional Information
No Public Explanation
Workaround
IMapServerObjects.RefreshSererObjects() function must be called twice to solve this particular problem.Here is the portion of code that fails at 9.2: //make the current map the same as the old map mapcurrent.clearLayers(); mapcurrent.clearMapSurrounds(); for(int i = originalMap.getLayerCount()-1 ; i >= 0 ; --i) mapcurrent.addLayer(originalMap.getLayer(i)); ((MapServer)server).refreshServerObjects();Here is the workaround solution: //making the current mapcurrent.ClearLayers(); mapcurrent.ClearMapSurrounds(); ((MapServer)server).RefreshServerObjects(); // refreshServerObject for (int i = originalMap.getLayerCount() - 1; i >= 0; --i) mapcurrent.AddLayer(originalMap.getLayer(i)); ((MapServer)server).RefreshServerObjects(); // refreshServerObject again