The Zoom in and Zoom out tools can fail to work within the ASP.NET MultiView control.
最後に公開された状態: August 25, 2014No 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