/// <summary> /// 对象选择事件。 /// GeometrySelectedEvent /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void m_mapControl_GeometrySelected(Object sender, SuperMap.UI.GeometrySelectedEventArgs e) { if (m_selectMode != SelectMode.SelectBarrier) { return; } Selection selection = m_layerPoint.Selection; if (selection.Count <= 0) { selection = m_layerLine.Selection; } GeoStyle style = new GeoStyle(); style.LineColor = Color.Red; Recordset recordset = selection.ToRecordset(); try { Geometry geometry = recordset.GetGeometry(); // 捕捉到点时,将捕捉到的点添加到障碍点列表中 // If a point is snapped, the point is added to the barrier list if (geometry.Type == GeometryType.GeoPoint) { GeoPoint geoPoint = (GeoPoint)geometry; int id = recordset.GetID(); m_barrierNodes.Add(id); style.MarkerSize = new Size2D(4, 4); geoPoint.Style = style; m_trackingLayer.Add(geoPoint, "barrierNode"); } // 捕捉到线时,将线对象添加到障碍线列表中 // If a line is snapped, the line is added to the barrier list if (geometry.Type == GeometryType.GeoLine) { GeoLine geoLine = (GeoLine)geometry; int id = recordset.GetID(); m_barrierEdges.Add(id); style.LineWidth = 0.6; geoLine.Style = style; m_trackingLayer.Add(geoLine, "barrierEdge"); } m_mapControl.Map.Refresh(); } catch (Exception ex) { Trace.WriteLine(ex.Message); } finally { recordset.Dispose(); } }
// 对象选择事件 private void m_mapControl_GeometrySelected(object sender, SuperMap.UI.GeometrySelectedEventArgs e) { try { Recordset recordset = GetSelectedRecordset(false); GeoPoint gp = recordset.GetGeometry() as GeoPoint; sender = gp; if (CameraDataAdjustHandler != null) { CameraDataAdjustHandler(sender); } if (WndDataViewer != null) { WndDataViewer(sender, e); } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
public void GeometrySelectedEventHandler4(object sender, SuperMap.UI.GeometrySelectedEventArgs e) { MessageBox.Show("4"); }