本文整理汇总了C#中GMarkerGoogle类的典型用法代码示例。如果您正苦于以下问题:C# GMarkerGoogle类的具体用法?C# GMarkerGoogle怎么用?C# GMarkerGoogle使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
GMarkerGoogle类属于命名空间,在下文中一共展示了GMarkerGoogle类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddMarker
void AddMarker(string uid, double lat, double lng)
{
var marker = new GMarkerGoogle(new PointLatLng(lat, lng),
GMarkerGoogleType.blue);
string name = string.Format("{0} - {1}:{2}", uid, lat, lng);
marker.ToolTip = new GMapToolTip(marker);
marker.ToolTipText = name;
markersOverlay.Markers.Add(marker);
}
示例2: buttonShowAllDepartments_Click
private void buttonShowAllDepartments_Click(object sender, EventArgs e)
{
gMapControl1.Overlays.Clear();
foreach (var c in Program.banksSystem.Department)
{
//Создание маркера
GMapOverlay markersOverlay = new GMapOverlay(c.Bank1.Id.ToString());
GMarkerGoogle marker = new GMarkerGoogle(new PointLatLng(c.Сoordinate_y, c.Сoordinate_x), GMarkerGoogleType.green);
//Добавляем описание
marker.ToolTip = new GMapRoundedToolTip(marker);
marker.ToolTipText = c.Bank1.Name + "\n" + c.Name + "\n" + c.Address + "\n" + c.Phone + "\n";
var departmentCurrencies = (from depCurr in Program.banksSystem.DeprtmentsСurrencies
join curr in Program.banksSystem.Сurrency on depCurr.Сurrency equals curr
where depCurr.Department == c.Id
select new
{
Currency = curr.Name,
Buy = depCurr.Buy,
Sell = depCurr.Sell
}).ToList();
foreach (var cur in departmentCurrencies)
{
marker.ToolTipText += cur.Currency + " " + cur.Buy + " " + cur.Sell + "\n";
}
//Добавляем на карту
markersOverlay.Markers.Add(marker);
gMapControl1.Overlays.Add(markersOverlay);
//fix ставим на правильное место
gMapControl1.Position = gMapControl1.Position;
}
}
示例3: MainForm_Load
private void MainForm_Load(object sender, EventArgs e)
{
gMapControl1.MapProvider = GoogleMapProvider.Instance;
gMapControl1.Manager.Mode = AccessMode.ServerOnly;
GMapProvider.WebProxy = null;
gMapControl1.Position = new PointLatLng(ClientSettings.DefaultLatitude, ClientSettings.DefaultLongitude);
gMapControl1.DragButton = MouseButtons.Left;
gMapControl1.MinZoom = 1;
gMapControl1.MaxZoom = 20;
gMapControl1.Zoom = 15;
gMapControl1.Overlays.Add(searchAreaOverlay);
gMapControl1.Overlays.Add(pokestopsOverlay);
gMapControl1.Overlays.Add(pokemonsOverlay);
gMapControl1.Overlays.Add(playerOverlay);
playerMarker = new GMarkerGoogle(new PointLatLng(ClientSettings.DefaultLatitude, ClientSettings.DefaultLongitude),
GMarkerGoogleType.orange_small);
playerOverlay.Markers.Add(playerMarker);
InitializeMap();
InitializePokemonForm();
if (ClientSettings.TransferType == "Duplicate")
{
Settings.Instance.SetSetting("CP Duplicate", "TransferType");
Settings.Instance.Reload();
}
}
示例4: CreateMapMarker
/// <summary>
/// Creates the map marker and adds it to the map
/// </summary>
public void CreateMapMarker(PointLatLng point, string tooltip)
{
GMarkerGoogle marker = new GMarkerGoogle(point, GMarkerGoogleType.red);
marker.ToolTipText = tooltip;
gmap.Overlays[0].Markers.Add(marker);
gmap.UpdateMarkerLocalPosition(marker);
}
示例5: Form1_Load
private void Form1_Load(object sender, EventArgs e)
{
// Initialize map:
gMapControl.MapProvider = GMap.NET.MapProviders.GoogleMapProvider.Instance;
GMap.NET.GMaps.Instance.Mode = GMap.NET.AccessMode.ServerOnly;
gMapControl.Position = new GMap.NET.PointLatLng(0.06,34);
// gMapControl.SetPositionByKeywords("Embu, kenya");
//Placing a marker on a certain position
GMapOverlay markersOverlay = new GMapOverlay("markers");
GMarkerGoogle marker = new GMarkerGoogle(new PointLatLng(0.06, 34.2),
GMarkerGoogleType.green);
marker.ToolTipText = "This is the first marker we put up";
marker.ToolTipMode = MarkerTooltipMode.OnMouseOver;
markersOverlay.Markers.Add(marker);
gMapControl.Overlays.Add(markersOverlay);
GMapOverlay markersOverlaymaseno = new GMapOverlay("markers");
GMarkerGoogle masenomarker = new GMarkerGoogle(new PointLatLng(45, 45),
GMarkerGoogleType.blue);
masenomarker.ToolTipText = "This is the second marker we put up";
masenomarker.ToolTipMode = MarkerTooltipMode.OnMouseOver;
markersOverlay.Markers.Add(masenomarker);
gMapControl.Overlays.Add(markersOverlay);
markersOverlay.Markers.Add(marker);
gMapControl.Overlays.Add(markersOverlay);
GMapOverlay markersOverlaythird = new GMapOverlay("markers");
GMarkerGoogle thirdmarker = new GMarkerGoogle(new PointLatLng(-45, 45),
GMarkerGoogleType.red);
thirdmarker.ToolTipText = "This is the third marker we put up";
thirdmarker.ToolTipMode = MarkerTooltipMode.OnMouseOver;
markersOverlay.Markers.Add(thirdmarker);
gMapControl.Overlays.Add(markersOverlay);
GMapOverlay polyOverlay = new GMapOverlay("polygons");
List<PointLatLng> points = new List<PointLatLng>();
points.Add(new PointLatLng(-25.969562, 32.585789));
points.Add(new PointLatLng(-25.966205, 32.588171));
points.Add(new PointLatLng(-25.968134, 32.591647));
points.Add(new PointLatLng(-25.971684, 32.589759));
GMapPolygon polygon = new GMapPolygon(points, "mypolygon");
polygon.Fill = new SolidBrush(Color.FromArgb(50, Color.Red));
polygon.Stroke = new Pen(Color.Red, 1);
polyOverlay.Polygons.Add(polygon);
gMapControl.Overlays.Add(polyOverlay);
}
示例6: AddDefaultGoogleMarker
public static void AddDefaultGoogleMarker(this Collection<GMapMarker> source, PointLatLng? point, GMarkerGoogleType style, object tag = null)
{
if (point != null)
{
GMarkerGoogle m = new GMarkerGoogle((PointLatLng)point, style);
m.ToolTip = new GMapRoundedToolTip(m);
m.ToolTipMode = MarkerTooltipMode.OnMouseOver;
m.Tag = tag;
source.Add(m);
}
}
示例7: handleLiveGeoLocations
private void handleLiveGeoLocations(GeoCoordinate coords)
{
this.Invoke(new MethodInvoker(() =>
{
double lat = Convert.ToDouble(textBox1.Text);
double lon = Convert.ToDouble(textBox2.Text);
markersOverlay.Markers.Clear();
GMarkerGoogle marker = new GMarkerGoogle(new GMap.NET.PointLatLng(lat, lon), GMarkerGoogleType.red);
markersOverlay.Markers.Add(marker);
map.Overlays.Add(markersOverlay);
map.Position = new GMap.NET.PointLatLng(coords.Latitude, coords.Longitude);
}));
}
示例8: button1_Click
private void button1_Click(object sender, EventArgs e)
{
//Создание маркера
GMapOverlay markersOverlay = new GMapOverlay("markers");
GMarkerGoogle marker = new GMarkerGoogle(new PointLatLng(53.899906, 27.562688), GMarkerGoogleType.green);
//Добавляем описание
marker.ToolTip = new GMapRoundedToolTip(marker);
marker.ToolTipText = "Красная площадь";
//Добавляем на карту
markersOverlay.Markers.Add(marker);
gMapControl1.Overlays.Add(markersOverlay);
//fix ставим на правильное место
gMapControl1.Position = new GMap.NET.PointLatLng(53.9018722, 27.6574339);
}
示例9: pictureBox2_Click
private void pictureBox2_Click(object sender, EventArgs e)
{
//Drop a waypoint to my location give or take
var r= new Random();
double randomLat=43.389758+0.0001*r.Next(-100,100);
double randomLon=-80.405068+0.0001*r.Next(-100,100);
GMarkerGoogle marker = new GMarkerGoogle(new GMap.NET.PointLatLng
(randomLat, randomLon),
GMarkerGoogleType.green_dot);
m_markersOverlay.Markers.Add(marker);
gMapControl1.Overlays.Add(m_markersOverlay);
}
示例10: createMarker
public static void createMarker(double x, double y, string name)
{
try
{
markersOverlay = new GMapOverlay("markers");
GMarkerGoogle marker = new GMarkerGoogle(new PointLatLng(x, y), GMarkerGoogleType.red_dot);
DateTime dt = DateTime.Now;
marker.ToolTipMode = MarkerTooltipMode.Always;
marker.ToolTip = new GMapToolTip(marker);
marker.ToolTipText = (x + ", " + y + ", " + dt.ToString("hh:mm:ss.ffff"));
if (markers.Any() && markers.First().Value.AddMinutes(saveTimeFor) < DateTime.Now)//markersPlaced >= 6)
{
//markers.ElementAt(1).IsVisible = true;
//markers.ElementAt(2).IsVisible = false;
//markers.ElementAt(1).IsVisible = false;
//markers.ElementAt(0).IsVisible = false;
//markers.Last().Dispose();
overlays.ToList().First().Markers.Remove(markers.First().Key);
markers.Remove(markers.First().Key);
overlays.Remove(overlays.ToList().First());
}
else
{
markersPlaced++;
}
markersOverlay.Markers.Add(marker);
markers.Add(marker, dt);
overlays.Add(markersOverlay);
Program.mainForm.gMap.Invoke(new Action(() =>
{
Program.mainForm.gMap.Overlays.Add(markersOverlay);
Program.mainForm.gMap.Position = marker.Position;
//gMap.Position = main;
}
));
}
catch (Exception ex)
{
Console.WriteLine("Create Marker: " + ex);
}
}
示例11: destinationMenuItem_Click
private void destinationMenuItem_Click(object sender, EventArgs e)
{
GMarkerGoogle marker = new GMarkerGoogle(gPoint, GMarkerGoogleType.red);
markers.Markers.Add(marker);
PointLatLng start = new PointLatLng(markers.Markers[0].Position.Lat, markers.Markers[0].Position.Lng);
PointLatLng end = new PointLatLng(markers.Markers[1].Position.Lat, markers.Markers[1].Position.Lng);
MapRoute route = GMap.NET.MapProviders.GoogleMapProvider.Instance.GetRoute(
start,
end,
false,
false,
14
);
GMapRoute r = new GMapRoute(route.Points, "My route");
GMapOverlay routesOverlay = new GMapOverlay("routes");
routesOverlay.Routes.Add(r);
myMap.Overlays.Add(routesOverlay);
// Térkép frissítése a route felrakása után, különben csak egy zoomolás után látszik a route.
myMap.UpdateRouteLocalPosition(r);
myMap.Invalidate();
}
示例12: Form1_Load_1
private void Form1_Load_1(object sender, EventArgs e)
{
this.gMapControl1.BackColor = Color.Red;
//设置控件的管理模式
this.gMapControl1.Manager.Mode = AccessMode.ServerAndCache;
//设置控件显示的地图来源
this.gMapControl1.MapProvider = GMapProviders.GoogleChinaMap;
//设置控件显示的当前中心位置
gp = GMapProviders.OpenStreetMap as GeocodingProvider;
//31.7543, 121.6281
this.gMapControl1.Position = new PointLatLng(28.210422, 112.976478);
//设置控件最大的缩放比例
this.gMapControl1.MaxZoom = 18;
//设置控件最小的缩放比例
this.gMapControl1.MinZoom = 1;
//设置控件当前的缩放比例
this.gMapControl1.Zoom = 11;
//创建一个新图层
routes = new GMapOverlay("routes");
MyMark = new GMapOverlay("MyMark");
routes.IsVisibile = true;//可以显示
MyMark.IsVisibile = true;
this.gMapControl1.Overlays.Add(routes);//添加到图层列表中
this.gMapControl1.Overlays.Add(MyMark);
//创建一个图标
GMapMarker gMapMarker = new GMarkerGoogle(gMapControl1.Position, GMarkerGoogleType.arrow);
//添加图层routes中
gMapMarker.ToolTipText = "我的商店";
this.MyMark.Markers.Add(gMapMarker);
// this.gMapControl1.Dock = DockStyle.Fill;//将控件全屏显示
gMapControl1.Overlays.Add(polygons);
}
示例13: addNode
public static void addNode(int nodeNum, double x, double y)
{
try
{
markersOverlay = new GMapOverlay("markers");
PointLatLng point = new PointLatLng(x, y);
GMarkerGoogle markerNode = new GMarkerGoogle(point, GMarkerGoogleType.green);
markersOverlay.Markers.Add(markerNode);
markerNode.ToolTipMode = MarkerTooltipMode.Always;
markerNode.ToolTip = new GMapToolTip(markerNode);
markerNode.ToolTipText = "Node " + nodeNum;
Program.mainForm.gMap.Invoke(new Action(() =>
{
Program.mainForm.gMap.Overlays.Add(markersOverlay);
Program.mainForm.gMap.Position = point;
//gMap.Position = main;
//Program.mainForm.addMarker(marker, markersOverlay, name);
//Program.mainForm.addNode(nodeNum, x, y, markersOverlay);
//gMap.Position = main;
}
));
}
catch (Exception ex)
{
Console.WriteLine("Add Node: " + ex.Message);
}
}
示例14: addPathMarker
public void addPathMarker(PointLatLng point)
{
if (lPointsPath.Count == 1)
{
//adds a marker to the begginging of the path
GMarkerGoogle newMarker = new GMarkerGoogle(point, GMarkerGoogleType.green);
MarkerOverlay.Markers.Add(newMarker);
}
else if (lPointsPath.Count > 2)
{
//adds markers to each point on the path except the first
//leaves most recent point empty in case the path is ended there and the ending marker needs to be placed
GMarkerGoogle newMarker = new GMarkerGoogle(lPointsPath[lPointsPath.Count - 2], GMarkerGoogleType.gray_small);
MarkerOverlay.Markers.Add(newMarker);
}
}
示例15: btnPathEnd_Click
private void btnPathEnd_Click(object sender, EventArgs e)
{
endPath();
//adds marker to end of path
if (lPointsPath.Count > 0)
{
GMarkerGoogle newMarker = new GMarkerGoogle(lPointsPath.Last<PointLatLng>(), GMarkerGoogleType.red);
MarkerOverlay.Markers.Add(newMarker);
}
}