private void Drawpoint_callback(GraphicsLayer gLayer, IGraphics graphics, List <Point> logPntArr) { this.m_graphicsLayer.DrawingOverCallback = null; this.m_graphicsLayer.RemoveAll(); if (logPntArr.Count > 0) { Dot_2D dot = new Dot_2D(); dot.x = logPntArr[0].X; dot.y = logPntArr[0].Y; obj1 = dot; } int GdbIndex = this.IMSCatalog.ActiveLayerObj.ActiveGdbIndex; if (GdbIndex < 0) { MessageBox.Show("在矢量图层中没有激活的图层!"); return; } else { if (this.IMSCatalog.ActiveLayerObj.ActiveLayerIndex == -1) { MessageBox.Show("在矢量图层中没有激活的图层!"); return; } } selFeature(); }
private void Drawpoint_callback(GraphicsLayer gLayer, IGraphics graphics, List <Point> logPntArr) { this.m_graphicsLayer.DrawingOverCallback = null; this.m_graphicsLayer.RemoveAll(); if (logPntArr.Count > 0) { Dot_2D dot = new Dot_2D(); dot.x = logPntArr[0].X; dot.y = logPntArr[0].Y; obj1 = dot; } string mapName = this.IMSCatalog.ActiveMapDoc.MapDocName; if (mapName == null) { MessageBox.Show("在矢量文档中没有激活的文档!"); return; } else { if (this.IMSCatalog.ActiveMapDoc.ActiveLayerIndex == -1) { MessageBox.Show("在矢量文档中没有激活的文档!"); return; } } selFeature(); }
/// <summary> /// 点击查询回调 /// </summary> private void DotSelect(GraphicsLayer gLayer, IGraphics graphics, List <Point> logPntArr) { if (logPntArr.Count > 0) { Dot_2D dot = new Dot_2D(); dot.x = logPntArr[0].X; dot.y = logPntArr[0].Y; this.select(dot, SelectionType.SpatialRange); } }
private void DotConSelectCallback(GraphicsLayer gLayer, IGraphics graphics, List <Point> logPntArr) { if (logPntArr.Count > 0) { Dot_2D dot = new Dot_2D(); dot.x = logPntArr[0].X; dot.y = logPntArr[0].Y; m_conditionInput.SelectionType = SelectionType.Both; m_conditionInput.QueryGeoObj = dot; m_conditionInput.Show(); } }
/// <summary> /// 添加点 /// </summary> /// <param name="gLayer">GraphicsLayer图层对象</param> /// <param name="graphics">绘图对象</param> /// <param name="logPntArr">绘图保存的逻辑坐标数组</param> public void AddDot(GraphicsLayer gLayer, IGraphics graphics, List <Point> logPntArr) { if (ActiveLayerObj != null && logPntArr.Count > 0) { if (ActiveLayerObj.ActiveGdbIndex < 0 || ActiveLayerObj.ActiveLayerIndex < 0) { MessageBox.Show("请激活矢量图层的一个点图层", "提示", MessageBoxButton.OK); return; } Dot_2D dot = new Dot_2D(); dot.x = logPntArr[0].X; dot.y = logPntArr[0].Y; m_targetGeo = dot; CSetLayerIndex setIdx = new CSetLayerIndex(); setIdx.GdbIndex = ActiveLayerObj.ActiveGdbIndex; setIdx.LayerIndex = ActiveLayerObj.ActiveLayerIndex; ActiveLayerObj.GetGeomType(setIdx, new UploadStringCompletedEventHandler(CheckPointType)); } }
private static List <Point> GetLogPnts(AnyLine lines) { AnyLine _tmp = lines; List <Point> logPnts = new List <Point>(); Point _p; Dot_2D _dot; for (int i = 0; i < _tmp.Arcs.Length; i++) { for (int j = 0; j < _tmp.Arcs[i].Dots.Length; j++) { _dot = new Dot_2D(); _dot = _tmp.Arcs[i].Dots[j]; _p = new Point(_dot.x, _dot.y); logPnts.Add(_p); } } return(logPnts); }
private void DotConSelectCallback(GraphicsLayer gLayer, IGraphics graphics, List <Point> logPntArr) { if (logPntArr.Count > 0) { Dot_2D dot = new Dot_2D(); dot.x = logPntArr[0].X; dot.y = logPntArr[0].Y; if (m_catalog.ActiveMapDoc != null && m_catalog.ActiveMapDoc.Display) { m_mapDocConditionInput.SelectionType = SelectionType.Both; m_mapDocConditionInput.QueryGeoObj = dot; m_mapDocConditionInput.Show(); } if (m_catalog.ActiveLayerObj != null && m_catalog.ActiveLayerObj.Display) { m_layerConditionInput.SelectionType = SelectionType.Both; m_layerConditionInput.QueryGeoObj = dot; m_layerConditionInput.Show(); } } }
private void submit(object sender, RoutedEventArgs e) { if (this.IMSMap == null) { MessageBox.Show("imsmap属性未赋值。"); return; } if ((this.ProjLat_src.Text.Length > 0 && !CommFun.IsNumber(this.ProjLat_src.Text)) || (ProjLat1_src.Text.Length > 0 && !CommFun.IsNumber(this.ProjLat1_src.Text)) || (ProjLat2_src.Text.Length > 0 && !CommFun.IsNumber(this.ProjLat2_src.Text)) || (DLon_src.Text.Length > 0 && !CommFun.IsNumber(this.DLon_src.Text)) || (DLon_des.Text.Length > 0 && !CommFun.IsNumber(this.DLon_des.Text)) || (ProjLat_des.Text.Length > 0 && !CommFun.IsNumber(this.ProjLat_des.Text)) || (ProjLat1_des.Text.Length > 0 && !CommFun.IsNumber(this.ProjLat1_des.Text)) || (ProjLat2_des.Text.Length > 0 && !CommFun.IsNumber(this.ProjLat2_des.Text))) { MessageBox.Show("请输入合法数字!"); return; } param_src = new ProjectParam(); param_des = new ProjectParam(); param_src.ProjLon = Convert.ToDouble(this.DLon_src.Text); this.ProjRate_Scale_src(param_src, 0); this.ProjType_coor_src(param_src, 0); if (param_src.ProjType != EnumType.TYPE_JWD) { this.ProjTypeID_IProjTypeId_src(param_src, 0); this.ProjZoneNO_IZone_src(param_src, 0); this.ProjZoneType_BZoneType_src(param_src, 0); } this.ProjUnit_unit_src(param_src, 0); this.SphereID_ISpheroid_src(param_src, 0); this.ProjAngleUnit_DAngUnit_src(param_src, 0); if (param_src.ProjTypeID == EnumProjType.Lambert || param_src.ProjTypeID == EnumProjType.Albers) { param_src.ProjLat = Convert.ToDouble(this.ProjLat_src.Text); param_src.ProjLat1 = Convert.ToDouble(this.ProjLat1_src.Text); param_src.ProjLat2 = Convert.ToDouble(this.ProjLat2_src.Text); } if (param_src.ProjTypeID == EnumProjType.Polyconic || param_src.ProjTypeID == EnumProjType.Transverse_Mecator) { param_src.ProjLat = Convert.ToDouble(this.ProjLat_src.Text); } param_des.ProjLon = Convert.ToDouble(this.DLon_des.Text); this.ProjRate_Scale_src(param_des, 1); this.ProjType_coor_src(param_des, 1); if (param_des.ProjType != EnumType.TYPE_JWD) { this.ProjTypeID_IProjTypeId_src(param_des, 1); this.ProjZoneNO_IZone_src(param_des, 1); this.ProjZoneType_BZoneType_src(param_des, 1); } this.ProjUnit_unit_src(param_des, 1); this.SphereID_ISpheroid_src(param_des, 1); this.ProjAngleUnit_DAngUnit_src(param_des, 1); if (param_des.ProjTypeID == EnumProjType.Lambert || param_des.ProjTypeID == EnumProjType.Albers) { param_des.ProjLat = Convert.ToDouble(this.ProjLat_des.Text); param_des.ProjLat1 = Convert.ToDouble(this.ProjLat1_des.Text); param_des.ProjLat2 = Convert.ToDouble(this.ProjLat2_des.Text); } if (param_des.ProjTypeID == EnumProjType.Polyconic || param_des.ProjTypeID == EnumProjType.Transverse_Mecator) { param_des.ProjLat = Convert.ToDouble(this.ProjLat_des.Text); } CProjectDots obj = new CProjectDots(); obj.SrcProjParam = param_src; obj.DesProjParm = param_des; Dot_2D dot = new Dot_2D(); dot.x = Convert.ToDouble(this.coorx_src.Text); dot.y = Convert.ToDouble(this.coory_src.Text); obj.InputDots = new Dot_2D[1]; obj.InputDots[0] = new Dot_2D(); obj.InputDots[0] = dot; this._spatial = new SpacialAnalyse(vectorObj); this._spatial.ProjectDots(obj, new UploadStringCompletedEventHandler(onSubmit)); }