コード例 #1
0
ファイル: TextFactory.cs プロジェクト: AnuoF/MapFrame
        /// <summary>
        ///创建图元
        /// </summary>
        /// <param name="kml"></param>
        /// <param name="layer"></param>
        /// <returns></returns>
        public Core.Interface.IMFElement CreateElement(Core.Model.Kml kml, ILayer layer)
        {
            KmlText kmlText = kml.Placemark.Graph as KmlText;

            if (kmlText == null)
            {
                return(null);
            }
            if (kmlText.Position == null)
            {
                return(null);
            }

            CompositeGraphicsLayerClass graphicLayer = layer as CompositeGraphicsLayerClass;

            if (graphicLayer == null)
            {
                return(null);
            }

            Text_ArcMap textElement = new Text_ArcMap(mapControl, kmlText, mapFactory);

            textElement.ElementType = ElementTypeEnum.Text;
            graphicLayer.AddElement(textElement, 0);

            return(textElement);
        }
コード例 #2
0
ファイル: EditText.cs プロジェクト: AnuoF/MapFrame
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="_mapControl">arcgis地图控件</param>
        /// <param name="_element">要编辑的文字图元</param>
        public EditText(AxMapControl _mapControl, IMFElement _element)
        {
            mapControl = _mapControl;
            currTool   = _mapControl.CurrentTool;

            editElement = _element as Text_ArcMap;
            if (editElement != null)
            {
                graphicsContainer = GetLayerByName(editElement.BelongLayer.LayerName) as CompositeGraphicsLayerClass;
            }
        }
コード例 #3
0
ファイル: EditText.cs プロジェクト: AnuoF/MapFrame
 /// <summary>
 /// 释放该类
 /// </summary>
 public void Dispose()
 {
     ReleaseCommond();
     CommondExecutedEvent = null;
     currTool             = null;
     mapControl           = null;
     textCtr           = null;
     editElement       = null;
     editElement       = null;
     graphicsContainer = null;
 }