目的:
1.arcgis server9.2 ADF实现Buffer Select功能

准备工作:
1.(六、一)的工程,具体见前篇。

开始:
1.在Toolbar1中新建一个Tool,ClientAction属性为"Point" ;Name属性为"BufferSelect" ;ServerActionAssembly属性为SelectTool;ServerActionClass属性为SelectTool.BufferTool;Text属性为"Buffer Point" ;ToolTip属性为"Buffer Point" 。
2.新建BufferTool.cs文件用来实现BufferSelect Tool的功能,BufferSelect实现IMapServerToolAction接口,具体代码和说明如下:

  1ArcGIS.Server.9.2.DotNet自带例子分析(六、二)void IMapServerToolAction.ServerAction(ToolEventArgs args)
  2        }
3.在Default.aspx页面上添加TextBox1,用来buffer值的输入,当值输入完成后把这个值存入到Session["BufferDistance"]中,在Page_Load事件中为这个TextBox1添加onkeyup的脚本方法名为ChangeBufferContext()。
1ArcGIS.Server.9.2.DotNet自带例子分析(六、二)protected void Page_Load(object sender, EventArgs e)
2        }
4.接下在编写脚本方法ChangeBufferContext,切换到html视图添加这个方法,代码和说明具体如下:
 1ArcGIS.Server.9.2.DotNet自带例子分析(六、二)function ChangeClient()
 2         }
5.完成客户的js代码后还需要在服务端的RaiseCallbackEvent方法中对请求进行处理,具体代码和说明如下:
 1ArcGIS.Server.9.2.DotNet自带例子分析(六、二) //接受客户端的请求进行处理
 2ArcGIS.Server.9.2.DotNet自带例子分析(六、二)        public void RaiseCallbackEvent(string eventArgs)
 3        }
6.接下来在添加一个button用来实现ClearSelection功能,具体的html代码如下:
1ArcGIS.Server.9.2.DotNet自带例子分析(六、二)<input type="button" ID="Button1" Style="left: 575px; value="Clear Selection" onclick="ChangeClearSelection()" />
7.还需要编写ChangeClearSelection脚本方法来实现这个功能,具体代码和说明如下:
 1ArcGIS.Server.9.2.DotNet自带例子分析(六、二)//清除选择
 2ArcGIS.Server.9.2.DotNet自带例子分析(六、二)         function ChangeClearSelection()
 3       
8.同样还需要在服务端的RaiseCallbackEvent方法中对请求进行处理,具体代码和说明如下:
 1ArcGIS.Server.9.2.DotNet自带例子分析(六、二)//接受客户端的请求进行处理
 2ArcGIS.Server.9.2.DotNet自带例子分析(六、二)        public void RaiseCallbackEvent(string eventArgs)
 3
9.这样就完成了这个例子,可以运行查看效果。
ArcGIS.Server.9.2.DotNet自带例子分析(六、二)

相关文章:

  • 2022-02-08
  • 2021-07-19
  • 2021-08-26
  • 2022-02-28
  • 2022-02-07
  • 2022-01-26
  • 2022-01-29
  • 2021-07-14
猜你喜欢
  • 2021-11-26
  • 2021-07-09
  • 2021-09-03
  • 2021-07-26
  • 2022-02-13
  • 2022-03-07
  • 2022-02-17
相关资源
相似解决方案