default.aspx.cs

来自「arcgis server9.2 (graphicElement)图形元素操作」· CS 代码 · 共 55 行

CS
55
字号
// Copyright 2006 ESRI
// 
// All rights reserved under the copyright laws of the United States
// and applicable international laws, treaties, and conventions.
// 
// You may freely redistribute and use this sample code, with or
// without modification, provided you include the original copyright
// notice and use restrictions.
// 
// See use restrictions at /arcgis/developerkit/userestrictions.

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;

public partial class _Default : System.Web.UI.Page, ICallbackEventHandler 
{
    public string sADFCallBackFunctionInvocation;
    private string returnstring = "";

    public void RaiseCallbackEvent(string eventArgs)
    {
        if (eventArgs.Contains("clearallbutton"))
        {
            ClearAllLayers();
        }        
    }

    public string GetCallbackResult()
    {
        return returnstring;
    }

    protected void ClearAllLayers()
    {
        ESRI.ArcGIS.ADF.Web.DataSources.ArcGISServer.MapFunctionality ags_mf = (ESRI.ArcGIS.ADF.Web.DataSources.ArcGISServer.MapFunctionality)Map1.GetFunctionality(0);
        ESRI.ArcGIS.ADF.ArcGISServer.MapDescription mapdescription = ags_mf.MapDescription;
        mapdescription.CustomGraphics = null;
        Map1.Refresh();
        returnstring = Map1.CallbackResults.ToString();
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        sADFCallBackFunctionInvocation = Page.ClientScript.GetCallbackEventReference(this, "message", "processCallbackResult", "context", "postBackError", true);
    }

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?