IMapArea::Extent throws "Unspecified Error" (E_FAIL / 0x80004005) when accessed from CenterAndScale class.
上次发布: August 25, 2014No Product Found
漏洞 ID 编号
NIM006613
已提交
February 6, 2007
上次修改时间
June 5, 2024
适用范围
No Product Found
找到的版本
9.2
编程语言
VBA
状态
Will Not Be Addressed
开发团队已考虑过该问题或请求,并决定不会解决该问题。 问题的“其他信息”部分可能包含进一步说明。
附加信息
No Public Explanation
解决办法
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);