Exemplo n.º 1
0
 private void axMap1_MouseMoveEvent(object sender, _DMapEvents_MouseMoveEvent e)
 {
     if (!axMap1.Focused)
     {
         axMap1.Focus();
     }
 }
 private void OnMapMouseMove(object sender, _DMapEvents_MouseMoveEvent e)
 {
     if (EnableMapInteraction)
     {
         Console.WriteLine($"{_axMap.Longitude}, {_axMap.Latitude}");
     }
 }
Exemplo n.º 3
0
        private void MapMouseMoveEvent(object sender, _DMapEvents_MouseMoveEvent e)
        {
            var button = MouseEventHelper.ParseMouseButton(e.button);
            var args   = new MouseEventArgs(button, 1, e.x, e.y, 0);

            Invoke(sender, MouseMove, args);
        }
Exemplo n.º 4
0
        void AxMap1MouseMoveEvent(object sender, _DMapEvents_MouseMoveEvent e)
        {
            Labels labels = MainMap.get_DrawingLabels(0);

            labels.Clear();
            // it's assumed here that the layer we want to edit is the first 1 (with 0 index)
            int layerHandle = MainMap.get_LayerHandle(0);
            var sf          = MainMap.get_Shapefile(layerHandle);

            if (sf != null)
            {
                double projX = 0.0;
                double projY = 0.0;
                MainMap.PixelToProj(e.x, e.y, ref projX, ref projY);
                object result = null;
                var    ext    = new Extents();
                ext.SetBounds(projX, projY, 0.0, projX, projY, 0.0);
                if (sf.SelectShapes(ext, 0.0, SelectMode.INTERSECTION, ref result))
                {
                    int[] shapes = result as int[];
                    if (shapes != null && shapes.Length == 1)
                    {
                        string s = "";
                        for (int i = 0; i < sf.NumFields; i++)
                        {
                            s += sf.Field[i].Name + ": " + sf.CellValue[i, shapes[0]] + "\n";
                        }
                        labels.AddLabel(s, e.x + 80, e.y);
                    }
                }
            }
            MainMap.Redraw2(tkRedrawType.RedrawSkipDataLayers);
        }
        private void OnMapMouseMove(object sender, _DMapEvents_MouseMoveEvent e)
        {
            double utmX = 0, utmY = 0;

            _mapControl.PixelToProj(e.x, e.y, ref utmX, ref utmY);
            var g25Coord = FishingGrid.utmCoordinatesToGrid25(utmX, utmY, _majorGrid.UTMZone);

            txtCoord.Text = $"UTM: {_utmZone} {utmX.ToString("N0")}, {utmY.ToString("N0")}\r\nGrid25: {g25Coord.grid25Name}";
        }
Exemplo n.º 6
0
        private void axMap1_MouseMoveEvent(object sender, _DMapEvents_MouseMoveEvent e)
        {
            #region 原版添加标签
            if (sfMouseMove != null)
            {
                foreach (Shapefile sf in sfMouseMove.Values)
                {
                    labels              = sf.Labels;
                    labels.FontSize     = 15;
                    labels.FontBold     = true;
                    labels.FrameVisible = true;
                    labels.FrameType    = tkLabelFrameType.lfRectangle;
                    labels.AutoOffset   = false;
                    labels.OffsetX      = 40;

                    LabelCategory cat = labels.AddCategory("Red");
                    cat.FontColor = 255;

                    double projX = 0.0;
                    double projY = 0.0;
                    Map.PixelToProj(e.x, e.y, ref projX, ref projY);
                    object result = null;
                    var    ext    = new Extents();
                    ext.SetBounds(projX, projY, 0.0, projX, projY, 0.0);
                    if (sf.SelectShapes(ext, 0.00007, SelectMode.INTERSECTION, ref result))
                    {
                        if (labelFlag_MouseMove == 0)
                        {
                            mouseMoveOperate(result, sf, labels, projX, projY);

                            Map.Redraw();
                            movemoveenter++;
                            string tStr = "aaa:" + movemoveenter;
                            int    str  = labels.Count;
                            Debug.Print("labels:" + str);
                            labelFlag_MouseMove = 1;
                        }
                    }
                    else
                    {
                        if (labelFlag_MouseMove == 1)
                        {
                            sf.Labels.Clear();
                            labelFlag_MouseMove = 0;
                            Map.Redraw();
                            movemoveenter++;
                            string tStr = "bbb:" + movemoveenter;
                            int    str  = labels.Count;
                            Debug.Print("labels:" + str);
                        }
                    }
                }
            }
            #endregion
        }
Exemplo n.º 7
0
        /// <summary>
        /// Fires coordinate changed event
        /// </summary>
        void ProjectionMap_MouseMoveEvent(object sender, _DMapEvents_MouseMoveEvent e)
        {
            double x = 0.0, y = 0.0;

            this.PixelToProj((double)e.x, (double)e.y, ref x, ref y);

            string format = "#.000";
            string sx     = (x < -180.000) ? "<180.0" : (x > 180.0) ? ">180.0" : x.ToString(format);
            string sy     = (y < -90.0) ? "<90.0" : (y > 90.0) ? ">90.0" : y.ToString(format);

            FireCoordinateChanged(x, y, sx, sy);
        }
Exemplo n.º 8
0
        void MapMouseMoveEvent(object sender, _DMapEvents_MouseMoveEvent e)
        {
            #region 单重显示

            Shapefile sf = App.Map.get_Shapefile(1);
            if (sf != null)
            {
                Labels labels = sf.Labels;
                labels.FontSize     = 15;
                labels.FontBold     = true;
                labels.FrameVisible = true;
                labels.FrameType    = tkLabelFrameType.lfRectangle;
                labels.AutoOffset   = false;
                labels.OffsetX      = 40;

                LabelCategory cat = labels.AddCategory("Red");
                cat.FontColor = 255;

                double projX = 0.0;
                double projY = 0.0;
                App.Map.PixelToProj(e.x, e.y, ref projX, ref projY);
                object result = null;
                var    ext    = new Extents();
                ext.SetBounds(projX, projY, 0.0, projX, projY, 0.0);
                if (sf.SelectShapes(ext, 0.00005, SelectMode.INTERSECTION, ref result) && (p == 0))
                {
                    //string temp = GisPoint.readOneData(projX, projY);
                    //string tempx = temp + "℃";
                    //if(Convert.ToDouble(temp)>=50)
                    //{
                    //    labels.AddLabel(tempx, projX, projY, 0.0, 0);
                    //}
                    //else
                    //{
                    //    labels.AddLabel(tempx, projX, projY, 0.0, -1);
                    //}

                    //p = 1;
                }
                else
                {
                    sf.Labels.Clear();
                    p = 0;
                }
                App.Map.Redraw();
            }
            #endregion
        }
Exemplo n.º 9
0
        /// <summary>
        /// The map mouse move event.
        /// </summary>
        /// <param name="sender">
        /// The sender.
        /// </param>
        /// <param name="e">
        /// The e.
        /// </param>
        private void AxMap1MouseMoveEvent(object sender, _DMapEvents_MouseMoveEvent e)
        {
            double lat = 0.0, lon = 0.0;
            string coordinates;

            if (this.axMap1.PixelToDegrees(e.x, e.y, ref lon, ref lat))
            {
                coordinates = string.Format("{0:0.000}, {1:0.000}", lat, lon);
            }
            else
            {
                double clientX = 0.0, clientY = 0.0;
                this.axMap1.PixelToProj(e.x, e.y, ref clientX, ref clientY);
                coordinates = string.Format("{0:0.00}, {1:0.00}", clientX, clientY);
            }

            this.statusStripCoordinates.Text = coordinates;
            this.statusStripCoordinates.Invalidate();
            this.statusStripEx1.Update();
        }
Exemplo n.º 10
0
 private void OnMapMouseMove(object sender, _DMapEvents_MouseMoveEvent e)
 {
     if (EnableMapInteraction)
     {
     }
 }
Exemplo n.º 11
0
 void AxMap1MouseMoveEvent2(object sender, _DMapEvents_MouseMoveEvent e)
 {
 }