Esempio n. 1
0
        public override void OnClick()
        {
            ILayer pLayer = (ILayer)_mapControl.CustomProperty;

            if (pLayer is IGroupLayer)
            {
                //获取GroupLayer中的图层
                var subLayers = LayerUtil.GetFeatureLayersFromGroupLayer(pLayer as IGroupLayer);
                foreach (var subLayer in subLayers)
                {
                    _mapControl.Map.DeleteLayer(subLayer);
                    AOUtil.ReleaseComObjectAllRefs(subLayer);
                }
            }
            _mapControl.Map.DeleteLayer(pLayer);
            _mapControl.ActiveView.Refresh();
            AOUtil.ReleaseComObjectAllRefs(pLayer);
        }