本文整理汇总了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
{
//.........这里部分代码省略.........
示例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;
}
}
}
}
}