本文整理汇总了C#中GMap.NET.PointLatLng.Offset方法的典型用法代码示例。如果您正苦于以下问题:C# PointLatLng.Offset方法的具体用法?C# PointLatLng.Offset怎么用?C# PointLatLng.Offset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GMap.NET.PointLatLng
的用法示例。
在下文中一共展示了PointLatLng.Offset方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MainMap_MouseMove
void MainMap_MouseMove(object sender, MouseEventArgs e)
{
//在规划模式下生效
if (isPlanMode)
{
PointLatLngAlt point = gMapControl1.FromLocalToLatLng(e.X, e.Y);
if (MouseDownStart == point)
return;
currentMarker.Position = point;
if (!isMouseDown)
{
SetMouseDisplay(point.Lat, point.Lng, 0);
}
//draging
if (e.Button == MouseButtons.Left && isMouseDown)
{
isMouseDraging = true;
if (CurrentRallyPt != null)
{
PointLatLng pnew = gMapControl1.FromLocalToLatLng(e.X, e.Y);
CurrentRallyPt.Position = pnew;
}
else if (groupmarkers.Count > 0)
{
// group drag
double latdif = MouseDownStart.Lat - point.Lat;
double lngdif = MouseDownStart.Lng - point.Lng;
MouseDownStart = point;
Hashtable seen = new Hashtable();
foreach (var markerid in groupmarkers)
{
if (seen.ContainsKey(markerid))
continue;
seen[markerid] = 1;
for (int a = 0; a < objectsoverlay.Markers.Count; a++)
{
var marker = objectsoverlay.Markers[a];
if (marker.Tag != null && marker.Tag.ToString() == markerid.ToString())
{
var temp = new PointLatLng(marker.Position.Lat, marker.Position.Lng);
temp.Offset(latdif, -lngdif);
marker.Position = temp;
}
}
}
}
else if (CurentRectMarker != null) // left click pan
{
try
{
// check if this is a grid point
if (CurentRectMarker.InnerMarker.Tag.ToString().Contains("grid"))
{
drawnpolygon.Points[int.Parse(CurentRectMarker.InnerMarker.Tag.ToString().Replace("grid", "")) - 1] = new PointLatLng(point.Lat, point.Lng);
gMapControl1.UpdatePolygonLocalPosition(drawnpolygon);
gMapControl1.Invalidate();
}
}
catch { }
PointLatLng pnew = gMapControl1.FromLocalToLatLng(e.X, e.Y);
// adjust polyline point while we drag
try
{
if (CurrentGMapMarker != null && CurrentGMapMarker.Tag is int)
{
int? pIndex = (int?)CurentRectMarker.Tag;
if (pIndex.HasValue)
{
if (pIndex < wppolygon.Points.Count)
{
wppolygon.Points[pIndex.Value] = pnew;
lock (thisLock)
{
gMapControl1.UpdatePolygonLocalPosition(wppolygon);
}
}
}
}
}
catch { }
// update rect and marker pos.
if (currentMarker.IsVisible)
{
currentMarker.Position = pnew;
}
CurentRectMarker.Position = pnew;
//.........这里部分代码省略.........