laptop and a wrench

漏洞

Map::SetExtent does not work consistently when the aspect ratio of the new extent differs from the map display's aspect ratio.

上次发布: August 25, 2014 ArcGIS Runtime for Windows Mobile
漏洞 ID 编号 NIM038935
已提交October 1, 2008
上次修改时间June 5, 2024
适用范围ArcGIS Runtime for Windows Mobile
找到的版本9.3
操作系统Windows OS
操作系统版本XP
修正版本N/A
状态Fixed

解决办法

For code to work in all aspect ratios try the following code- // Assign the new envelope to be the map's envelopedouble dWHAspect = Convert.ToDouble(theMap.Width) / Convert.ToDouble(theMap.Height);double dWHExtent = envelope.Width / envelope.Height;if (dWHAspect > dWHExtent){ // make width wider double dCenterX = envelope.MinX + (envelope.MaxX - envelope.MinX) / 2; double dCenterY = envelope.MinY + (envelope.MaxY - envelope.MinY) / 2; double dHeight = envelope.MaxY - envelope.MinY; double dWidth = dHeight * dWHAspect; envelope = new Envelope(new Coordinate(dCenterX, dCenterY), dWidth, dHeight);}else{ // make height wider double dCenterX = envelope.MinX + (envelope.MaxX - envelope.MinX)/2; double dCenterY = envelope.MinY + (envelope.MaxY - envelope.MinY) / 2; double dWidth = envelope.MaxX - envelope.MinX; double dHeight = dWidth / dWHAspect; envelope = new Envelope(new Coordinate(dCenterX, dCenterY), dWidth, dHeight);}envelope.Resize(1.5);theMap.SetExtent(envelope);theMap.Invalidate();

重现步骤

漏洞 ID: NIM038935

软件:

  • ArcGIS Runtime for Windows Mobile

当漏洞状态发生变化时获得通知

下载 Esri 支持应用程序

发现关于本主题的更多内容

获取来自 ArcGIS 专家的帮助

联系技术支持部门

下载 Esri 支持应用程序

转至下载选项