Пример #1
0
        /// <summary>
        /// 移除图元
        /// </summary>
        /// <param name="elementName">图元名称</param>
        /// <returns>true,成功;false,失败</returns>
        public bool RemoveElement(string elementName)
        {
            if (string.IsNullOrEmpty(elementName))
            {
                return(false);
            }

            bool       ret     = false;
            IMFElement element = null;

            lock (_elementDic)
            {
                if (!_elementDic.ContainsKey(elementName))
                {
                    return(false);
                }
                element = _elementDic[elementName];
            }

            if (element != null)
            {
                ret = _mapFactory.RemoveElement(LayerName, element);
            }

            if (ret)
            {
                lock (_elementDic)
                {
                    _elementDic.Remove(elementName);
                }

                _mapFactory.Refresh();
            }

            return(ret);
        }
Пример #2
0
 /// <summary>
 /// 重绘
 /// </summary>
 public void Refresh()
 {
     mapFactory.Refresh();
 }