本文整理汇总了C#中GMapMarkerRect类的典型用法代码示例。如果您正苦于以下问题:C# GMapMarkerRect类的具体用法?C# GMapMarkerRect怎么用?C# GMapMarkerRect使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GMapMarkerRect类属于命名空间,在下文中一共展示了GMapMarkerRect类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: createMarker
GMapMarker createMarker(PointLatLng pos) {
GMapMarkerVector marker = new GMapMarkerVector(pos);
if (objects.Markers.Count % 2.0 == 0)
marker = new GMapMarkerRect(pos);
marker.Pen =new Pen(Color.FromArgb(144, Color.MidnightBlue),2);
marker.IsHitTestVisible = true;
marker.ToolTipMode = MarkerTooltipMode.OnMouseOver;
routes.Markers.Add(marker);
if (routes.Markers.Count > 1)
marker.ToolTipText = routes.Routes[0].Distance + "";// rMap1.Manager.GetDistance(pos, objects.Markers[objects.Markers.Count - 1].Position) + "";
return marker;
}
示例2: addpolygonmarker
private void addpolygonmarker(string tag, double lng, double lat, int alt, Color? color, GMapOverlay overlay)
{
try
{
PointLatLng point = new PointLatLng(lat, lng);
GMarkerGoogle m = new GMarkerGoogle(point, GMarkerGoogleType.green);
m.ToolTipMode = MarkerTooltipMode.Always;
m.ToolTipText = tag;
m.Tag = tag;
GMapMarkerRect mBorders = new GMapMarkerRect(point);
{
mBorders.InnerMarker = m;
try
{
mBorders.wprad =
(int) (float.Parse(MainV2.config["TXT_WPRad"].ToString())/CurrentState.multiplierdist);
}
catch
{
}
if (color.HasValue)
{
mBorders.Color = color.Value;
}
}
overlay.Markers.Add(m);
overlay.Markers.Add(mBorders);
}
catch (Exception)
{
}
}
示例3: MainMap_OnMarkerLeave
void MainMap_OnMarkerLeave(GMapMarker item)
{
if (!isMouseDown)
{
if (item is GMapMarkerRect)
{
CurentRectMarker = null;
GMapMarkerRect rc = item as GMapMarkerRect;
rc.ResetColor();
gMapControl1.Invalidate(false);
}
if (item is GMapMarkerRallyPt)
{
CurrentRallyPt = null;
}
if (item is GMapMarker)
{
// when you click the context menu this triggers and causes problems
CurrentGMapMarker = null;
}
}
}
示例4: addpolygonmarker
/// <summary>
/// used to add a marker to the map display
/// </summary>
/// <param name="tag"></param>
/// <param name="lng"></param>
/// <param name="lat"></param>
/// <param name="alt"></param>
private void addpolygonmarker(string tag, double lng, double lat, int alt, Color? color)
{
try
{
PointLatLng point = new PointLatLng(lat, lng);
GMapMarkerWP m = new GMapMarkerWP(point, tag);
m.ToolTipMode = MarkerTooltipMode.OnMouseOver;
m.ToolTipText = "高度: " + alt.ToString("0");
m.Tag = tag;
try
{
// preselect groupmarker
if (groupmarkers.Count > 0)
if (groupmarkers.Contains(int.Parse(tag)))
m.selected = true;
}
catch { }
//MissionPlanner.GMapMarkerRectWPRad mBorders = new MissionPlanner.GMapMarkerRectWPRad(point, (int)float.Parse(TXT_WPRad.Text), MainMap);
GMapMarkerRect mBorders = new GMapMarkerRect(point);
{
mBorders.InnerMarker = m;
mBorders.Tag = tag;
//隐藏到达航点半径
//mBorders.wprad = (int)(float.Parse(TXT_WPRad.Text) / CurrentState.multiplierdist);
if (color.HasValue)
{
mBorders.Color = color.Value;
}
}
objectsoverlay.Markers.Add(m);
objectsoverlay.Markers.Add(mBorders);
}
catch (Exception) { }
}
示例5: MainMap_OnMarkerEnter
void MainMap_OnMarkerEnter(GMapMarker item)
{
if (!isMouseDown)
{
if (item is GMapMarkerRect)
{
GMapMarkerRect rc = item as GMapMarkerRect;
rc.Pen.Color = Color.Red;
MainMap.Invalidate(false);
CurentRectMarker = rc;
}
}
}
示例6: button4_Click
// add marker on current position
private void button4_Click(object sender, EventArgs e)
{
GMarkerGoogle m = new GMarkerGoogle(currentMarker.Position, GMarkerGoogleType.green_pushpin);
GMapMarkerRect mBorders = new GMapMarkerRect(currentMarker.Position);
{
mBorders.InnerMarker = m;
if (polygon != null)
{
mBorders.Tag = polygon.Points.Count;
}
mBorders.ToolTipMode = MarkerTooltipMode.Always;
}
Placemark? p = null;
if (checkBoxPlacemarkInfo.Checked)
{
GeoCoderStatusCode status;
var ret = GMapProviders.GoogleMap.GetPlacemark(currentMarker.Position, out status);
if (status == GeoCoderStatusCode.G_GEO_SUCCESS && ret != null)
{
p = ret;
}
}
if (p != null)
{
mBorders.ToolTipText = p.Value.Address;
}
else
{
mBorders.ToolTipText = currentMarker.Position.ToString();
}
objects.Markers.Add(m);
objects.Markers.Add(mBorders);
RegeneratePolygon();
}
示例7: MainMap_OnMarkerLeave
void MainMap_OnMarkerLeave(GMapMarker item)
{
if (item is GMapMarkerRect)
{
CurentRectMarker = null;
GMapMarkerRect rc = item as GMapMarkerRect;
rc.Pen.Color = Color.Blue;
// Debug.WriteLine("OnMarkerLeave: " + item.Position);
}
}
示例8: MainMap_OnMarkerEnter
void MainMap_OnMarkerEnter(GMapMarker item)
{
if (item is GMapMarkerRect)
{
GMapMarkerRect rc = item as GMapMarkerRect;
rc.Pen.Color = Color.Red;
CurentRectMarker = rc;
// Debug.WriteLine("OnMarkerEnter: " + item.Position);
}
}
示例9: MainMap_OnMarkerLeave
void MainMap_OnMarkerLeave(GMapMarker item)
{
if (!isMouseDown)
{
if (item is GMapMarkerRect)
{
CurentRectMarker = null;
GMapMarkerRect rc = item as GMapMarkerRect;
rc.Pen.Color = Color.Blue;
MainMap.Invalidate(false);
}
}
}
示例10: addpolygonmarker
/// <summary>
/// used to add a marker to the map display
/// </summary>
/// <param name="tag"></param>
/// <param name="lng"></param>
/// <param name="lat"></param>
/// <param name="alt"></param>
private void addpolygonmarker(string tag, double lng, double lat, int alt)
{
try
{
PointLatLng point = new PointLatLng(lat, lng);
GMapMarkerGoogleGreen m = new GMapMarkerGoogleGreen(point);
m.ToolTipMode = MarkerTooltipMode.Always;
m.ToolTipText = tag;
m.Tag = tag;
//ArdupilotMega.GMapMarkerRectWPRad mBorders = new ArdupilotMega.GMapMarkerRectWPRad(point, (int)float.Parse(TXT_WPRad.Text), MainMap);
GMapMarkerRect mBorders = new GMapMarkerRect(point);
{
mBorders.InnerMarker = m;
mBorders.wprad = (int)float.Parse(TXT_WPRad.Text);
mBorders.MainMap = MainMap;
}
objects.Markers.Add(m);
objects.Markers.Add(mBorders);
}
catch (Exception) { }
}
示例11: MainMap_OnMarkerEnter
void MainMap_OnMarkerEnter(GMapMarker item)
{
if (!isMouseDown)
{
if (item is GMapMarkerRect)
{
GMapMarkerRect rc = item as GMapMarkerRect;
rc.Pen.Color = Color.Green;
MainMap.Invalidate(false);
CurentRectMarker = rc;
int answer;
if (item.Tag != null && rc.InnerMarker != null && int.TryParse(rc.InnerMarker.Tag.ToString(), out answer))
{
try
{
missionDataGrid.CurrentCell = missionDataGrid[0, answer - 1];
item.ToolTipText = "Altitude: " + missionDataGrid[ALTCOL.Index, answer - 1].Value.ToString()+"m";
item.ToolTipMode = MarkerTooltipMode.OnMouseOver;
}
catch { }
}
}
}
}
示例12: addpolygonmarkergrid
private void addpolygonmarkergrid(string tag, double lng, double lat, int alt)
{
try
{
PointLatLng point = new PointLatLng(lat, lng);
GMapMarkerGoogleRed m = new GMapMarkerGoogleRed(point);
m.ToolTipMode = MarkerTooltipMode.Never;
m.ToolTipText = "grid" + tag;
m.Tag = "grid" + tag;
//ArdupilotMega.GMapMarkerRectWPRad mBorders = new ArdupilotMega.GMapMarkerRectWPRad(point, (int)float.Parse(TXT_WPRad.Text), MainMap);
GMapMarkerRect mBorders = new GMapMarkerRect(point);
{
mBorders.InnerMarker = m;
}
drawnpolygons.Markers.Add(m);
drawnpolygons.Markers.Add(mBorders);
}
catch (Exception) { }
}
示例13: MainMap_OnMarkerEnter
void MainMap_OnMarkerEnter(GMapMarker item)
{
if (!isMouseDown)
{
if (item is GMapMarkerRect)
{
GMapMarkerRect rc = item as GMapMarkerRect;
rc.Pen.Color = Color.Red;
gMapControl1.Invalidate(false);
int answer;
if (item.Tag != null && rc.InnerMarker != null && int.TryParse(rc.InnerMarker.Tag.ToString(), out answer))
{
try
{
Commands.CurrentCell = Commands[0, answer - 1];
item.ToolTipText = "高度: " + Commands[Alt.Index, answer - 1].Value;
item.ToolTipMode = MarkerTooltipMode.OnMouseOver;
}
catch { }
}
CurentRectMarker = rc;
}
if (item is GMapMarkerRallyPt)
{
CurrentRallyPt = item as GMapMarkerRallyPt;
}
if (item is GMapMarkerAirport)
{
// do nothing - readonly
return;
}
if (item is GMapMarker)
{
CurrentGMapMarker = item;
}
}
}
示例14: AddLocation
public void AddLocation(string szAddress)
{
textBoxGeo.Text = szAddress;
GeoCoderStatusCode status = GeoCoderStatusCode.Unknow;
PointLatLng? pos = GMaps.Instance.GetLatLngFromGeocoder("Ruckersville, " + szAddress, out status);
if (pos != null && status == GeoCoderStatusCode.G_GEO_SUCCESS)
{
GMapMarker m = new GMapMarkerGoogleGreen(pos.Value);
GMapMarkerRect mBorders = new GMapMarkerRect(pos.Value);
mBorders.Size = new System.Drawing.Size(100, 100);
{
mBorders.ToolTipText = szAddress;
mBorders.TooltipMode = MarkerTooltipMode.Always;
}
objects.Markers.Add(m);
objects.Markers.Add(mBorders);
}
}
示例15: MainForm_KeyUp
// key-up events
private void MainForm_KeyUp(object sender, KeyEventArgs e)
{
int offset = -22;
if (e.KeyCode == Keys.Left)
{
MainMap.Offset(-offset, 0);
}
else if (e.KeyCode == Keys.Right)
{
MainMap.Offset(offset, 0);
}
else if (e.KeyCode == Keys.Up)
{
MainMap.Offset(0, -offset);
}
else if (e.KeyCode == Keys.Down)
{
MainMap.Offset(0, offset);
}
else if (e.KeyCode == Keys.Delete)
{
if (currentPolygon != null)
{
polygons.Polygons.Remove(currentPolygon);
currentPolygon = null;
}
if (currentRoute != null)
{
routes.Routes.Remove(currentRoute);
currentRoute = null;
}
if (CurentRectMarker != null)
{
objects.Markers.Remove(CurentRectMarker);
if (CurentRectMarker.InnerMarker != null)
{
objects.Markers.Remove(CurentRectMarker.InnerMarker);
}
CurentRectMarker = null;
//RegeneratePolygon();
}
}
else if (e.KeyCode == Keys.Escape)
{
MainMap.Bearing = 0;
}
}