private void axMapControl1_OnMouseDown(object sender, IMapControlEvents2_OnMouseDownEvent e) { if (e.button == 4) { AeUtils.Pan(); } else if (e.button == 1 && _isShowInfo) { IPoint pPoint = new PointClass() { X = e.mapX, Y = e.mapY }; m_pMapC2.Map.SelectByShape(pPoint, null, true); m_pMapC2.Refresh(esriViewDrawPhase.esriViewGeoSelection, null, null); IEnumFeature pEnumFeature = m_pMapC2.Map.FeatureSelection as IEnumFeature; IFeature pFeature = pEnumFeature.Next(); if (pFeature == null) { return; } int FID = (int)pFeature.get_Value(0); new FormInfo(AeUtils.GetLayerByName("Building") as IFeatureLayer, FID).Show(); } }
private void btn_BuildingInfo_Click(object sender, EventArgs e) { _isShowInfo = !_isShowInfo; if (_isShowInfo) { btn_BuildingInfo.Text = "查看建筑信息\n(状态:开启)"; (AeUtils.GetLayerByName("Plan") as IFeatureLayer).Selectable = false; (AeUtils.GetLayerByName("Plan") as IFeatureLayer).Selectable = false; } else { btn_BuildingInfo.Text = "查看建筑信息\n(状态:关闭)"; (AeUtils.GetLayerByName("Plan") as IFeatureLayer).Selectable = true; (AeUtils.GetLayerByName("Road") as IFeatureLayer).Selectable = true; } }