laptop and a wrench

Bug

IMapArea::Extent throws "Unspecified Error" (E_FAIL / 0x80004005) when accessed from CenterAndScale class.

Last Published: August 25, 2014 No Product Found
Bug ID Number NIM006613
SubmittedFebruary 6, 2007
Last ModifiedJune 5, 2024
Applies toNo Product Found
Version found9.2
Program languageVBA
StatusWill Not Be Addressed

Additional Information

No Public Explanation

Workaround

Once you set the MapArea property of the MapDescription using centerAndScale, you still have to calculate the map extent. You can calculate the map extent by either exporting the map image or the layout. This will ensure that the map extent is calculated on the server and map extent will be valid. Please take a look at the modifications that we made in your code. Please feel free to contact me if you have additional questions related to this incident. pMapDesc.MapArea = centerAndScale as IMapArea; //Now you specified the scale and the center of your map... Map Extent has not been computed on the server //You need to export the map image or the layout in order to calculate the map extent. IImageDescription imageDesc = mServerContext.CreateObject("esriCarto.ImageDescription") as IImageDescription; IImageType imageType = mServerContext.CreateObject("esriCarto.ImageType") as IImageType; imageType.ReturnType= esriImageReturnType.esriImageReturnURL; imageType.Format= esriImageFormat.esriImagePNG; imageDesc.Type = imageType; IImageDisplay imageDisplay = mServerContext.CreateObject("esriCarto.ImageDisplay") as IImageDisplay; imageDisplay.Height = 300; imageDisplay.Width = 300; imageDesc.Display = imageDisplay; //ExportMapImage will calculate the map extent on the server IMapImage mapImage = pMapServer.ExportMapImage(pMapDesc, imageDesc); Debug.Print(mapImage.URL); IMapServerLayout pMSLayout = pMapServer as IMapServerLayout; IPageDescription pPageDesc = pMSLayout.DefaultPageDescription; imageDisplay.Height = 0; imageDisplay.Width = 0; imageDisplay.DeviceResolution=96; imageDesc.Display = imageDisplay; pPageDesc.MapFrames.get_Element(0).MapDescription = pMapDesc; //ExportLayout does also calculate the map extent on the server. ILayoutImage pLayoutImage = pMSLayout.ExportLayout(pPageDesc, imageDesc); Debug.Print(pLayoutImage.URL);

Steps to Reproduce

Bug ID: NIM006613

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