laptop and a wrench

Erro

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

Última Publicação: August 25, 2014 No Product Found
Número de ID do Erro NIM010242
EnviadoJuly 10, 2007
Última ModificaçãoJune 5, 2024
Aplica-se àNo Product Found
Versão encontrada9.2
Idioma do programaC#
StatusWill Not Be Addressed

Informações Adicionais

No Public Explanation

Solução Provisória

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

Etapas para Reproduzir

ID do Erro: NIM010242

Software:

  • No Product Found

Seja notificado quando o status de um erro mudar

Baixe o Aplicativo de Suporte da Esri

Descubra mais sobre este tema

Obtenha ajuda de especialistas do ArcGIS

Entre em contato com Suporte Técnico

Baixe o Aplicativo de Suporte da Esri

Ir para as opções de download