laptop and a wrench

漏洞

The Zoom in and Zoom out tools can fail to work within the ASP.NET MultiView control.

上次发布: August 25, 2014 No Product Found
漏洞 ID 编号 NIM010242
已提交July 10, 2007
上次修改时间June 5, 2024
适用范围No Product Found
找到的版本9.2
编程语言C#
状态Will Not Be Addressed

附加信息

No Public Explanation

解决办法

Set the "EnablePostBack" property of each ToolbarItem in the toolbar control to "True". This will make the tools to work properly whether the view is active or not.But this workaround loses AJAX ability. Another workaround is to create a custom zoom in/out tool. Please follow the steps:1. Add a div tag around the map control, and define the mousedown and mouseUp events:<div onmousedown="corner1();" onmouseup="corner2();"><esri:Map....></div>2. Add two JS functions inside head tags<head id="Head1" runat="server"><script language=javascript type="text/javascript"> var xvalue1;var yvalue1;var xvalue2;var yvalue2;function corner1(){getXY(window.event);//(10,120) is the pixel value of the position of the upper left corner of the map controlxvalue1=mouseX-10;yvalue1=mouseY-120;}function corner2(){getXY(window.event);xvalue2=mouseX-10;yvalue2=mouseY-120;var map = Maps['Map1'];if (map.mode == 'Tool') { var message = xvalue1 + ',' + yvalue1 +',' + xvalue2 +','+ yvalue2;WebForm_DoCallback('__Page',message,processCallbackResult,null,null,true);} }</script> </head>3. On server side, implement ICallbackEventHandler interface as: #region ICallbackEventHandler Members public string GetCallbackResult() { Map1.Refresh(); return Map1.CallbackResults.ToString(); } public void RaiseCallbackEvent(string eventArgument) { //user may draw the rectangle from lower to upper, you should consider it. //The sample only shows when user draws it from upper left to lower right direction. string[] coordValues = eventArgument.Split(','); int x1= Convert.ToInt16(coordValues[0]); int y1= Convert.ToInt16(coordValues[1]); int x2= Convert.ToInt16(coordValues[2]); int y2= Convert.ToInt16(coordValues[3]); //RectangleEventArgs rectargs = (RectangleEventArgs)args; System.Drawing.Rectangle myrect = new System.Drawing.Rectangle(x1, y1, x2 - x1, y2 - y1); ESRI.ArcGIS.ADF.Web.Geometry.Point minpnt = ESRI.ArcGIS.ADF.Web.Geometry.Point.ToMapPoint(myrect.Left, myrect.Bottom, Map1.Extent, (int)Map1.Width.Value, (int)Map1.Height.Value); ESRI.ArcGIS.ADF.Web.Geometry.Point maxpnt = ESRI.ArcGIS.ADF.Web.Geometry.Point.ToMapPoint(myrect.Right, myrect.Top, Map1.Extent, (int)Map1.Width.Value, (int)Map1.Height.Value); ESRI.ArcGIS.ADF.Web.Geometry.Envelope mappoly = new ESRI.ArcGIS.ADF.Web.Geometry.Envelope(minpnt, maxpnt); Map1.Extent = mappoly; } #endregion

重现步骤

漏洞 ID: NIM010242

软件:

  • No Product Found

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

下载 Esri 支持应用程序

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

获取来自 ArcGIS 专家的帮助

联系技术支持部门

下载 Esri 支持应用程序

转至下载选项