当前位置: 首页>>代码示例>>C#>>正文


C# GMapPolygon.IsInside方法代码示例

本文整理汇总了C#中GMapPolygon.IsInside方法的典型用法代码示例。如果您正苦于以下问题:C# GMapPolygon.IsInside方法的具体用法?C# GMapPolygon.IsInside怎么用?C# GMapPolygon.IsInside使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GMapPolygon的用法示例。


在下文中一共展示了GMapPolygon.IsInside方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: MainMap_MouseUp

        void MainMap_MouseUp(object sender, MouseEventArgs e)
        {
            //在规划模式下生效
            if (isPlanMode)
            {
                if (isMouseClickOffMenu)
                {
                    isMouseClickOffMenu = false;
                    return;
                }
                MouseDownEnd = gMapControl1.FromLocalToLatLng(e.X, e.Y);

                if (e.Button == MouseButtons.Right)
                {
                    return;
                }
                if (isMouseDown)
                {
                    if (e.Button == MouseButtons.Left)
                        isMouseDown = false;

                    if (ModifierKeys == Keys.Control)
                    {
                        // group select wps
                        GMapPolygon poly = new GMapPolygon(new List<PointLatLng>(), "temp");

                        poly.Points.Add(MouseDownStart);
                        poly.Points.Add(new PointLatLng(MouseDownStart.Lat, MouseDownEnd.Lng));
                        poly.Points.Add(MouseDownEnd);
                        poly.Points.Add(new PointLatLng(MouseDownEnd.Lat, MouseDownStart.Lng));

                        foreach (var marker in objectsoverlay.Markers)
                        {
                            if (poly.IsInside(marker.Position))
                            {
                                try
                                {
                                    if (marker.Tag != null)
                                    {
                                        groupmarkeradd(marker);
                                    }
                                }
                                catch { }
                            }
                        }

                        isMouseDraging = false;
                        return;
                    }
                }
                if (!isMouseDraging)
                {
                    if (CurentRectMarker != null)
                    {

                    }
                    else
                    {
                        AddWPToMap(currentMarker.Position.Lat, currentMarker.Position.Lng, 0);
                    }
                }
                else
                {
                    if (groupmarkers.Count > 0)
                    {
                        Dictionary<string, PointLatLng> dest = new Dictionary<string, PointLatLng>();

                        foreach (var markerid in groupmarkers)
                        {
                            for (int a = 0; a < objectsoverlay.Markers.Count; a++)
                            {
                                var marker = objectsoverlay.Markers[a];

                                if (marker.Tag != null && marker.Tag.ToString() == markerid.ToString())
                                {
                                    dest[marker.Tag.ToString()] = marker.Position;
                                    break;
                                }
                            }
                        }

                        foreach (KeyValuePair<string, PointLatLng> item in dest)
                        {
                            var value = item.Value;
                            callMeDrag(item.Key, value.Lat, value.Lng, -1);
                        }

                        gMapControl1.SelectedArea = RectLatLng.Empty;
                        groupmarkers.Clear();
                        // redraw to remove selection
                        writeKML();

                        CurentRectMarker = null;
                    }
                    if (CurentRectMarker != null)
                    {
                        if (CurentRectMarker.InnerMarker.Tag.ToString().Contains("grid"))
                        {
                            try
                            {
//.........这里部分代码省略.........
开发者ID:kkouer,项目名称:PcGcs,代码行数:101,代码来源:GCS.cs

示例2: generateCoverageFP

        public void generateCoverageFP(GMapPolygon footprintpoly)
        {
            if (area.WidthLng > 1 || area.HeightLat > 1)
                return;

            for (double lat = Math.Round(area.Lat, 4); lat >= area.Bottom; lat -= 0.0001)
            {
                for (double lng = Math.Round(area.Lng, 4); lng <= area.Right; lng += 0.0001)
                {
                    var p = new PointLatLng(Math.Round(lat, 4), Math.Round(lng, 4));

                    if (footprintpoly.IsInside(p))
                    {
                        if (overlapCount.ContainsKey(p))
                        {
                            overlapCount[p]++;
                        }
                        else
                        {
                            overlapCount[p] = 1;
                        }
                    }
                }

            }
        }
开发者ID:AndersonRayner,项目名称:MissionPlanner,代码行数:26,代码来源:GMapMarkerOverlapCount.cs


注:本文中的GMapPolygon.IsInside方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。