コード例 #1
0
        /// <summary>
        /// 加载单个任务区 根据任务区实体类加载
        /// </summary>
        /// <param name="map"></param>
        /// <param name="model"></param>
        public static void LoadSatelliteTaskArea(Core.Map.MapHelper map, Core.Model.TASK_LAYOUT_LIST model)
        {
            if (model.TASKTYPE == 0)
            {
                ISymbol symbol = map.CreateSimpleSymbol(Color.OrangeRed, 4, esriSimpleMarkerStyle.esriSMSCross);
                IPoint  pPoint = new PointClass();
                pPoint.PutCoords(Convert.ToDouble(model.LON), Convert.ToDouble(model.LAT));
                //SatelliteResaultAreas = new List<IPolygon>();
                //SatelliteResaultAreas.Add(pPolygon);
                //添加任务区点
                map.AddElement(pPoint, symbol, "TaskArea");
                map.AddTextElement(pPoint, getTextElement(model.TASKNAME), "TaskAreaMark");
            }
            else
            {
                ISymbol  symbol  = map.CreateSimpleFillSymbol(Color.OrangeRed, 4, esriSimpleFillStyle.esriSFSHollow);
                string[] points  = model.AREASTRING.Split(' ');
                string   polygon = "";
                for (int i = 0; i < points.Length - 1; i += 2)
                {
                    polygon += points[i + 1] + "," + points[i] + ";";
                }

                IPolygon pPolygon = Core.Generic.Convertor.ToPolygon(polygon);
                SatelliteResaultAreas = new List <IPolygon>();
                SatelliteResaultAreas.Add(pPolygon);
                //添加任务区多边形
                map.AddElement(pPolygon, symbol, "TaskArea");
                map.AddTextElement(pPolygon, getTextElement(model.TASKNAME), "TaskAreaMark");
            }
        }
コード例 #2
0
        /// <summary>
        /// 加载单个任务区 根据任务区实体类加载
        /// </summary>
        /// <param name="map"></param>
        /// <param name="model"></param>
        public static void LoadTaskArea(Core.Map.MapHelper map, Core.Model.TaskAreas model)
        {
            ISymbol  symbol   = map.CreateSimpleFillSymbol(Color.Red, 4, esriSimpleFillStyle.esriSFSHollow);
            IPolygon pPolygon = Core.Generic.Convertor.ToPolygon(model.PolygonString);

            TaskAreas = new List <IPolygon>();
            TaskAreas.Add(pPolygon);
            //添加任务区多边形
            map.AddElement(pPolygon, symbol, "TaskArea");
            map.AddTextElement(pPolygon, getTextElement(model.Name), "TaskAreaMark");
        }