private void btnBufferAnalysis_Click(object sender, EventArgs e) { if (!isBuffering) { isBuffering = true; btnBufferAnalysis.Text = "停止寻找"; } else { isBuffering = false; for (int i = 0; i < mStoryTips.Count; i++) { MyTip tip = mStoryTips[i]; tip.Close(); } mStoryTips.Clear(); MapManager.deleteAllFeature("invisibleLayer", axMap); (axMap.Map as IGraphicsContainer).DeleteAllElements(); axMap.ActiveView.Refresh(); btnBufferAnalysis.Text = "附近人消息"; } }
private void axMapControl1_OnMouseDown(object sender, IMapControlEvents2_OnMouseDownEvent e) { if (axMap.MousePointer == esriControlsMousePointer.esriPointerPan) { axMap.Pan(); } if (e.button == 4) { // axMap.MousePointer = esriControlsMousePointer.esriPointerPan; axMap.Pan(); } if (isBuffering && e.button == 1) { //选择要素 selectFeatrue(e.x, e.y); if (mFeatures != null) { mFeatures.Clear(); } ////获取缓冲区的要素 mFeatures = MapManager.createBuffer(axMap, bufferSize, "story", false); //删除以前生成的缓冲区要素 for (int i = 0; i < mStoryTips.Count; i++) { MyTip tip = mStoryTips[i]; tip.Close(); } mStoryTips.Clear(); List <String> ids = new List <string>(); for (int i = 0; i < mFeatures.Count; i++) { IFeature feature = mFeatures[i]; if (feature != null) { String id = (string)MapManager.getFieldByName(feature, "story_id"); MyTip storyTip = new MyTip(id); storyTip.TopMost = true; storyTip.Location = MapManager.getCurrentCoord(feature, axMap, this, storyTip); if (isCanTipShow(storyTip)) { storyTip.Show(); } mStoryTips.Add(storyTip); } } } }