void m_Map_MouseDownEvent(object sender, AxMapWinGIS._DMapEvents_MouseDownEvent e) { m_MouseDownLoc = new System.Drawing.Point(e.x, e.y); if (e.shift == 1) { m_ShiftPressed = true; } else { m_ShiftPressed = false; } }
private void axMap1_MouseDownEvent(object sender, AxMapWinGIS._DMapEvents_MouseDownEvent e) { if (PointF == 1 || PointF == 3) { double xP = 0; double yP = 0; Shapefile sf = new Shapefile(); bool result = sf.CreateNewWithShapeID("", ShpfileType.SHP_POINT); MapWinGIS.Point pt = new MapWinGIS.Point(); axMap1.PixelToProj(e.x, e.y, ref xP, ref yP); pt.x = xP; pt.y = yP; comboBox1.Text = FindMinStop(xP, yP); Shape shp = new Shape(); shp.Create(ShpfileType.SHP_POINT); shp.InsertPoint(pt, 0); sf.EditInsertShape(shp, 0); sf.DefaultDrawingOptions.SetDefaultPointSymbol(tkDefaultPointSymbol.dpsStar); axMap1.AddLayer(sf, true); axMap1.SendMouseDown = false; } if (PointF == 2 || PointF == 4) { double xP = 0; double yP = 0; Shapefile sf = new Shapefile(); bool result = sf.CreateNewWithShapeID("", ShpfileType.SHP_POINT); MapWinGIS.Point pt = new MapWinGIS.Point(); axMap1.PixelToProj(e.x, e.y, ref xP, ref yP); pt.x = xP; pt.y = yP; comboBox2.Text = FindMinStop(xP, yP); Shape shp = new Shape(); shp.Create(ShpfileType.SHP_POINT); shp.InsertPoint(pt, 0); sf.EditInsertShape(shp, 0); sf.DefaultDrawingOptions.SetDefaultPointSymbol(tkDefaultPointSymbol.dpsStar); axMap1.AddLayer(sf, true); axMap1.SendMouseDown = false; } }
private void axMap1_MouseDownEvent(object sender, AxMapWinGIS._DMapEvents_MouseDownEvent e) { int layerHandler = axMap1.get_LayerHandle(7); Shapefile node = axMap1.get_Shapefile(layerHandler); if (node != null) { double projX = 0.0; double projY = 0.0; axMap1.PixelToProj(e.x, e.y, ref projX, ref projY); object result = null; Extents ext = new Extents(); ext.SetBounds(projX, projY, 0.0, projX, projY, 0.0); if (node.SelectShapes(ext, 10.0, SelectMode.INCLUSION, ref result)) { int[] shapes = result as int[]; if (shapes == null) { return; } if (shapes.Length > 1) { MessageBox.Show("Please select only one node for the device location."); } else { File.WriteAllText("..\\..\\devloc.txt", Convert.ToString(shapes[0])); MessageBox.Show("Device location was selected. Node number " + shapes[0]); } } else { MessageBox.Show("Please select a node to set device location."); } } }
private void AxMap1_MouseDownEvent(object sender, AxMapWinGIS._DMapEvents_MouseDownEvent e) { }