zoukankan      html  css  js  c++  java
  • arcgis 清除选择

    default.aspx页面:

     <esri:Command ClientAction="" Name="ClearSelection" DefaultImage="Images/MapTool/clear.gif"
                        HoverImage="Images/MapTool/clear.gif" SelectedImage="Images/MapTool/clear.gif"
                        ServerActionAssembly="App_Code" ServerActionClass="ClearSelection" Text="清除选择"
                        ToolTip="清除选择" />

    在app_code里面添加ClearSelection类,代码如下:

    //添加的引用
    using ESRI.ArcGIS.ADF.Web.UI.WebControls.Tools;
    using ESRI.ArcGIS.ADF.Web.UI.WebControls;
    using ESRI.ArcGIS.ADF.Web.DataSources.ArcGISServer;
    using ESRI.ArcGIS.ADF.ArcGISServer;

    /// <summary>
    ///ClearSelection 实现清除高亮显示命令
    /// </summary>
    public class ClearSelection : IMapServerCommandAction
    {
        public ClearSelection()
        {
            //
            //TODO: 在此处添加构造函数逻辑
            //
        }

        #region  IServerAction  Members
        void IServerAction.ServerAction(ToolbarItemInfo info)
        {
            Map map = info.BuddyControls[0] as Map;
            ESRI.ArcGIS.ADF.Web.DataSources.ArcGISServer.MapFunctionality mf;
            mf = map.GetFunctionality("Portland") as MapFunctionality;
            MapDescription mapDescription = mf.MapDescription;
            if (mapDescription.CustomGraphics == null)
                return;
            mapDescription.CustomGraphics = null;
            RefreshMap(map, "Portland");
        }
        #endregion
    }

     /// <summary>
        /// 刷新地图
        /// </summary>
        /// <param name="map"></param>
        /// <param name="resourceName"></param>
        /// ImageBlendingMode(地图图片融合方式属性),如果该值为WebTier刷新整个地图,否则只刷新指定的资源
        public static void RefreshMap(Map map, string resourceName)
        {
            //web层融合
            if (map.ImageBlendingMode == ImageBlendingMode.WebTier)
            {
                map.Refresh();
            }
            //浏览器端融合
            else if (map.ImageBlendingMode == ImageBlendingMode.Browser)
            {
                map.RefreshResource(resourceName);
            }
        }

  • 相关阅读:
    Tensorflowlite移植ARM平台iMX6
    人生信条集
    浅谈聚类
    常用距离度量方法大全
    sklearn学习小结
    SpringBoot 2.x版本+MultipartFile设置指定文件上传大小
    SpringBoot无法访问webapp目录下的文件
    idea搜索不到任何插件
    Caused by: org.springframework.data.mapping.PropertyReferenceException: No property id found for type Users!
    Annotation-specified bean name 'userDaoImpl' for bean class [***] conflicts with existing, non-compatible bean definition of same name and class [***]
  • 原文地址:https://www.cnblogs.com/lff255356/p/2737687.html
Copyright © 2011-2022 走看看