private void axMap1_MouseMoveEvent(object sender, AxMapWinGIS._DMapEvents_MouseMoveEvent e) { if (this.flagMapaAbierto) { //handle = this.axMap1.get_LayerHandle(0); //shpfile = (MapWinGIS.Shapefile)this.axMap1.get_GetObject(handle); // Convertimos las coordenadas de pantalla en una proyeccion de coordenadas this.axMap1.PixelToProj(e.x, e.y, ref CoordX, ref CoordY); if (enSeleccionCoord) { refreshMapa(); mem.DrawString(CoordY.ToString("0.000"), fuente, brochaTexto, e.x+10, e.y); mem.DrawString(CoordX.ToString("0.000"), fuente, brochaTexto, e.x+10, e.y-10); if (estaSelPos) { double latPixel = 0.0; double longPixel = 0.0; this.axMap1.ProjToPixel(CoordXSel, CoordYSel, ref longPixel, ref latPixel); brochaTexto.Color = Color.Black; mem.DrawString(CoordYSel.ToString("0.000"), fuente, brochaTexto, (float)longPixel + 10, (float)latPixel); mem.DrawString(CoordXSel.ToString("0.000"), fuente, brochaTexto, (float)longPixel + 10, (float)latPixel - 10); brochaTexto.Color = Color.Red; pluma.Color = Color.Black; mem.DrawEllipse(pluma, (float)longPixel - 5, (float)latPixel - 5, (float)10, (float)10); pluma.Color = Color.Red; } } this.toolStripStatusLabel1.Text = "LAT: " + CoordY.ToString("0.000"); this.toolStripStatusLabel2.Text = "LON: " + CoordX.ToString("0.000"); } }
private void axMap1_MouseUpEvent(object sender, AxMapWinGIS._DMapEvents_MouseUpEvent e) { if (enSeleccionCoord) { double lat = 0.0; double lon = 0.0; this.axMap1.PixelToProj(e.x, e.y, ref lon, ref lat); mainForm.setCoordenadasCanvas(lat, lon); CoordXSel = lon; CoordYSel = lat; //double latPixel = 0.0; //double longPixel = 0.0; //this.axMap1.ProjToPixel(lon, lat, ref longPixel, ref latPixel); //refreshMapa(); brochaTexto.Color = Color.Black; mem.DrawString(lat.ToString("0.000"), fuente, brochaTexto, e.x + 10, e.y); mem.DrawString(lon.ToString("0.000"), fuente, brochaTexto, e.x + 10, e.y - 10); brochaTexto.Color = Color.Red; pluma.Color = Color.Black; mem.DrawEllipse(pluma, (float)e.x - 5, (float)e.y - 5, (float)10, (float)10); pluma.Color = Color.Red; estaSelPos = true; ////mem.DrawRectangle(pluma, (float)e.x - 5, (float)e.y - 5, (float)10, (float)10); } }
private void axMap1_MouseDownEvent(object sender, AxMapWinGIS._DMapEvents_MouseDownEvent e) { }