• 大小: 10.45MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-10-07
  • 语言: C#
  • 标签: web  Arcgis  Engine  C#  

资源简介

此安全利用C#进行Arcgis Server的二次开发。一共包含24个例子,如地图属性查询,缓冲区分析,空间查询等常用的GIS功能。部分实例可以直接运行,少数实例可能需要经过简单的调试才可运行。

资源截图

代码片段和文件信息

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Collections.Specialized;

using ESRI.ArcGIS.ADF.Web.DataSources;

public partial class _Default : System.Web.UI.Page ICallbackEventHandler
{
    public string getResourceContentCallBack;
    public string showFieldInfoCallBack;
    public string attributeQueryCallBack;

    protected void Page_Load(object sender EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            //layerList.Attributes[“onchange“] = “ShowFieldInfo()“;
        }
        getResourceContentCallBack = Page.Clientscript.GetCallbackEventReference(this
            “message“ “processCallbackResult“ “context“ “postBackError“ true);
        showFieldInfoCallBack = Page.Clientscript.GetCallbackEventReference(this
            “message“ “processCallbackResult“ “context“ “postBackError“ true);
        attributeQueryCallBack = Page.Clientscript.GetCallbackEventReference(this
            “message“ “processCallbackResult“ “context“ “postBackError“ true);
    }

    protected void Page_PreRender(object sender EventArgs e)
    {
        //if (!IsPostBack)
        //    GetResourceContent();
    }

    private void GetResourceContent()
    {
        IMapFunctionality mf = (IMapFunctionality)Map1.GetFunctionality(“NorthAmericaMap“);
        IGISResource gisresource = mf.Resource;
        bool supported = gisresource.SupportsFunctionality(typeof(IQueryFunctionality));

        if (!supported)
            return;

        IQueryFunctionality qfunc = (IQueryFunctionality)gisresource.CreateFunctionality(typeof(IQueryFunctionality) null);

        string[] lids;
        string[] lnames;
        qfunc.GetQueryablelayers(null out lids out lnames);
        for (int i = 0; i < lnames.Length; i++)
        {
            ListItem item = new ListItem(lnames[i] lids[i]);
            //layerList.Items.Add(item);
        }
    }

    #region ICallbackEventHandler Members
    private string callbackArg;

    string ICallbackEventHandler.GetCallbackResult()
    {
        // 判断是否有相应的缓存信息
        string cachedResponse = Cache[callbackArg] as string;
        if (cachedResponse != null)
        {
            return cachedResponse;
        }

        // 将传入参数依据&分割符分到querystring变量中
        Array keyValuePairs = callbackArg.Split(“&“.ToCharArray());
        NameValueCollection queryString = new NameValueCollection();
        string[] keyValue;
        string response = ““;
        if (keyValuePairs.Length > 0)
        {
            for (int i = 0; i < keyValuePairs.Length; i++)
            {
                keyValue = keyValuePairs.GetValue(i).ToString().Split(“=“.ToCharArray());
                queryString.Add(keyValue[0] keyValue[1]);
            }
      

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2011-07-26 09:03  WebGIS 开发\
     目录           0  2011-07-26 09:01  WebGIS 开发\AttributeQuery\
     目录           0  2011-07-26 09:01  WebGIS 开发\AttributeQuery\App_Code\
     文件        8109  2008-10-05 17:19  WebGIS 开发\AttributeQuery\App_Code\GisFunctionality.cs
     目录           0  2011-07-26 09:03  WebGIS 开发\AttributeQuery\App_Data\
     目录           0  2011-07-26 09:01  WebGIS 开发\AttributeQuery\Bin\
     文件       40960  2006-01-15 09:49  WebGIS 开发\AttributeQuery\Bin\AspAlliance.CacheManager.dll
     文件       28672  2008-10-05 16:33  WebGIS 开发\AttributeQuery\Bin\xmlDataSource.dll
     文件       60928  2008-10-05 16:33  WebGIS 开发\AttributeQuery\Bin\xmlDataSource.pdb
     文件        7524  2011-07-25 17:22  WebGIS 开发\AttributeQuery\Default.aspx
     文件        4601  2008-10-01 00:07  WebGIS 开发\AttributeQuery\Default.aspx.cs
     目录           0  2011-07-26 09:01  WebGIS 开发\AttributeQuery\Images\
     目录           0  2011-07-26 09:01  WebGIS 开发\AttributeQuery\Images\Toolbar\
     文件       12705  2007-10-16 22:54  WebGIS 开发\AttributeQuery\Images\Toolbar\clearhighlight_1.jpg
     文件       12650  2007-10-16 22:54  WebGIS 开发\AttributeQuery\Images\Toolbar\clearhighlight_2.jpg
     文件       13331  2007-10-16 22:53  WebGIS 开发\AttributeQuery\Images\Toolbar\clearhighlight_3.jpg
     文件       12726  2007-10-17 16:27  WebGIS 开发\AttributeQuery\Images\Toolbar\fullextent_1.jpg
     文件       12703  2007-10-17 16:27  WebGIS 开发\AttributeQuery\Images\Toolbar\fullextent_2.jpg
     文件       13343  2007-10-17 16:27  WebGIS 开发\AttributeQuery\Images\Toolbar\fullextent_3.jpg
     文件       13312  2007-10-16 22:59  WebGIS 开发\AttributeQuery\Images\Toolbar\identify_1.jpg
     文件       13265  2007-10-16 23:00  WebGIS 开发\AttributeQuery\Images\Toolbar\identify_2.jpg
     文件       13954  2007-10-16 23:00  WebGIS 开发\AttributeQuery\Images\Toolbar\identify_3.jpg
     文件       12974  2007-10-16 23:02  WebGIS 开发\AttributeQuery\Images\Toolbar\pan_1.jpg
     文件       12949  2007-10-16 23:02  WebGIS 开发\AttributeQuery\Images\Toolbar\pan_2.jpg
     文件       13516  2007-10-16 23:02  WebGIS 开发\AttributeQuery\Images\Toolbar\pan_3.jpg
     文件       12709  2007-10-16 22:57  WebGIS 开发\AttributeQuery\Images\Toolbar\select_circle_1.jpg
     文件       12670  2007-10-16 22:57  WebGIS 开发\AttributeQuery\Images\Toolbar\select_circle_2.jpg
     文件       13233  2007-10-16 22:57  WebGIS 开发\AttributeQuery\Images\Toolbar\select_circle_3.jpg
     文件        2638  2008-05-22 14:36  WebGIS 开发\AttributeQuery\Images\Toolbar\select_line_1.jpg
     文件        2617  2008-05-22 14:36  WebGIS 开发\AttributeQuery\Images\Toolbar\select_line_2.jpg
     文件        2616  2008-05-22 14:37  WebGIS 开发\AttributeQuery\Images\Toolbar\select_line_3.jpg
............此处省略975个文件信息

评论

共有 条评论