本文整理汇总了C#中GMap.NET.WindowsForms.GMapOverlay类的典型用法代码示例。如果您正苦于以下问题:C# GMapOverlay类的具体用法?C# GMapOverlay怎么用?C# GMapOverlay使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GMapOverlay类属于GMap.NET.WindowsForms命名空间,在下文中一共展示了GMapOverlay类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DrawMarkers
public void DrawMarkers()
{
int i002 = 0;
int i003 = 0;
int i004 = 0;
if (points.Count == 0)
{
MessageBox.Show("У маршрута несуществует точек.");
return;
}
overlayOne = new GMapOverlay(gmap, "OverlayOne");
foreach (PointD p in points)
{
int s = getStatus(p.code);
if (s == 0)
{
i002++;
GMapCustomImageMarker a = new GMapCustomImageMarker(new PointLatLng(p.getx(), p.gety()));
a.Tag = p;
overlayOne.Markers.Add(a);
}
if (s == 1)
{
i004++;
GMapCustomImageMarkerRed a = new GMapCustomImageMarkerRed(new PointLatLng(p.getx(), p.gety()));
a.Tag = p;
overlayOne.Markers.Add(a);
}
if (s == 2)
{
i003++;
GMapCustomImageMarkerYellow a = new GMapCustomImageMarkerYellow(new PointLatLng(p.getx(), p.gety()));
a.Tag = p;
overlayOne.Markers.Add(a);
}
if (s == 3)
{
GMapCustomImageMarkerBlue a = new GMapCustomImageMarkerBlue(new PointLatLng(p.getx(), p.gety()));
a.Tag = p;
overlayOne.Markers.Add(a);
}
}
setStatusCount(i002, i003, i004);
DrawRoute();
gmap.Overlays.Clear();
gmap.Overlays.Add(overlayOne);
}
示例2: PlaybackSbxjHelper
public PlaybackSbxjHelper(RMap map,IContainer c) {
_map = map;
playOverlay = map.FindOverlay("play");
if (playOverlay == null) {
playOverlay = new GMapOverlay(map, "play");
map.Overlays.Add(playOverlay);
playRoute = new GMapRoute(new List<GMap.NET.PointLatLng>(), "play");
playRoute.Stroke.Color = Color.Red;
playRoute.Stroke.Width = 3;
playOverlay.Routes.Add(playRoute);
}
car = new GMapMarkerGoogleGreen(new GMap.NET.PointLatLng(0, 0));
car.ToolTipMode = MarkerTooltipMode.Always;
car.ToolTipText = "man";
car.ToolTip.Format.Alignment = StringAlignment.Near;
playOverlay.Markers.Add(car);
queue_pos = new Queue<gps_position>();
dataTimer = new Timer();
dataTimer.Tick += new EventHandler(dataTimer_Tick);
dataTimer.Interval = 1;
playTimer = new Timer();
playTimer.Tick += new EventHandler(playTimer_Tick);
playTimer.Interval = 1000;
}
示例3: addPIN
private void addPIN(PointLatLng point)
{
GMapOverlay markersOverlay = new GMapOverlay(gmap, "marker");
this.marker = new GMapMarkerGoogleRed(point);
markersOverlay.Markers.Add(marker);
gmap.Overlays.Add(markersOverlay);
marker.ToolTipText = this.article.mLink;
marker.ToolTipMode = MarkerTooltipMode.Never;
}
示例4: cbContrib_CheckedChanged
private void cbContrib_CheckedChanged(object sender, EventArgs e)
{
DataTable dtMapPin = new DataTable();
BusinessLayer.MapPin MapList = new BusinessLayer.MapPin();
int t = 1;
dtMapPin = MapList.getMapPinByType(t);
GMapOverlay mark = new GMapOverlay(gMapControl1, "mark");
if (cbContrib.Checked)
{
for (int j = 0; j < dtMapPin.Rows.Count; j++)
{
int m = Convert.ToInt32(dtMapPin.Rows[j]["CategoryID"]);
if (m == 2)
{
double x = Convert.ToDouble(dtMapPin.Rows[j]["XLOC"]);
double y = Convert.ToDouble(dtMapPin.Rows[j]["YLOC"]);
mark.Markers.Add(new GMap.NET.WindowsForms.Markers.GMapMarkerGoogleRed(new PointLatLng(x, y)));
}
//tell the map to add the overlay
gMapControl1.Overlays.Add(mark);
}
}
else
{
gMapControl1.Overlays.Clear();
}
}
示例5: SITL
public SITL()
{
InitializeComponent();
if (!Directory.Exists(sitldirectory))
Directory.CreateDirectory(sitldirectory);
homemarker.Position = MainV2.comPort.MAV.cs.HomeLocation;
myGMAP1.Position = homemarker.Position;
myGMAP1.MapProvider = GCSViews.FlightData.mymap.MapProvider;
myGMAP1.MaxZoom = 22;
myGMAP1.Zoom = 16;
myGMAP1.DisableFocusOnMouseEnter = true;
markeroverlay = new GMapOverlay("markers");
myGMAP1.Overlays.Add(markeroverlay);
markeroverlay.Markers.Add(homemarker);
myGMAP1.Invalidate();
try
{
if (simulator != null)
simulator.Kill();
}
catch { }
Utilities.ThemeManager.ApplyThemeTo(this);
MissionPlanner.Utilities.Tracking.AddPage(this.GetType().ToString(), this.Text);
}
示例6: Build_Prediction_Marker
public void Build_Prediction_Marker(PointLatLng Base_Position, string ACID, MySqlProvider.PredictionTableNumberType Table_Type, ref GMapOverlay Overlay)
{
MySqlProvider SqlProvider = new MySqlProvider();
System.Collections.Generic.List<MySqlProvider.PredictionDataSetOneRow> Record = SqlProvider.GetOneRecordPerTimeAndACID(Table_Type, SharedData.LookAheadTime, ACID, false);
// If prediction data for the given parameters exists
// then lets add it to the display list.
if (Record.Count > 0)
{
GeoCordSystemDegMinSecUtilities.LatLongClass P_Pont = new GeoCordSystemDegMinSecUtilities.LatLongClass(double.Parse(Record[0].Lat), double.Parse(Record[0].Lon));
PointLatLng PredictedPoint = new PointLatLng(P_Pont.GetLatLongDecimal().LatitudeDecimal, P_Pont.GetLatLongDecimal().LongitudeDecimal);
PredictionMarker PM;
string label = Record[0].ACID + "\n" + Record[0].Time.ToShortTimeString();
switch (Table_Type)
{
case MySqlProvider.PredictionTableNumberType.One:
PM = new PredictionMarker(Base_Position, Color.Magenta, PredictedPoint, label);
Overlay.Markers.Add(PM);
break;
case MySqlProvider.PredictionTableNumberType.Two:
PM = new PredictionMarker(Base_Position, Color.Blue, PredictedPoint, label);
Overlay.Markers.Add(PM);
break;
case MySqlProvider.PredictionTableNumberType.Three:
PM = new PredictionMarker(Base_Position, Color.Orange, PredictedPoint, label);
Overlay.Markers.Add(PM);
break;
}
}
}
示例7: GridUIv2
public GridUIv2(GridPluginv2 plugin)
{
this.plugin = plugin;
InitializeComponent();
map.MapProvider = plugin.Host.FDMapType;
map.Position = plugin.Host.FPMenuMapPosition;
map.Zoom = 16;
layerpolygons = new GMapOverlay( "polygons");
map.Overlays.Add(layerpolygons);
plugin.Host.FPDrawnPolygon.Points.ForEach(x => { list.Add(x); });
num_overlap = 50;
num_sidelap = 60;
NUM_altitude.Value = 50;
// set and angle that is good
NUM_angle.Value = (decimal)((getAngleOfLongestSide(list) + 360) % 360);
}
示例8: Build
public static void Build(ref GMapOverlay OverlayOut)
{
// Here loop through defined sectors and display them on the map
foreach (SystemAdaptationDataSet.SectorBorder Sector in SystemAdaptationDataSet.SectorBorderDataSet)
{
System.Collections.Generic.List<PointLatLng> SectorPointList = new System.Collections.Generic.List<PointLatLng>();
foreach (GeoCordSystemDegMinSecUtilities.LatLongClass SectorPoint in Sector.SectorBorderPoints)
{
SectorPointList.Add(new PointLatLng(SectorPoint.GetLatLongDecimal().LatitudeDecimal, SectorPoint.GetLatLongDecimal().LongitudeDecimal));
}
// Get sector border display attributes
DisplayAttributes.DisplayAttributesType SectorBorderDisplayAttribute = DisplayAttributes.GetDisplayAttribute(DisplayAttributes.DisplayItemsType.SectorBorder);
GMapPolygon SectorPolygon = new GMapPolygon(SectorPointList, Sector.SectorName);
SectorPolygon.Stroke = new Pen(SectorBorderDisplayAttribute.LineColor, SectorBorderDisplayAttribute.LineWidth);
Type brushType = typeof(Brushes);
Brush myBrush = (Brush)brushType.InvokeMember(SectorBorderDisplayAttribute.AreaPolygonColor.Name,
BindingFlags.Public | BindingFlags.Static | BindingFlags.GetProperty,
null, null, new object[] { });
SectorPolygon.Fill = myBrush;
OverlayOut.Polygons.Add(SectorPolygon);
}
}
示例9: MainForm
public MainForm()
{
InitializeComponent();
if(!DesignMode)
{
try
{
System.Net.IPHostEntry e = System.Net.Dns.GetHostEntry("www.bing.com");
}
catch
{
mapControl.Manager.Mode = AccessMode.CacheOnly;
MessageBox.Show("No internet connection avaible, going to CacheOnly mode.", "GMap.NET - CloudsDemo", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
mapControl.MapProvider = GMapProviders.BingSatelliteMap;
mapControl.OnMapZoomChanged += new MapZoomChanged(mapControl_OnMapZoomChanged);
mainOverlay = new GMapOverlay("top");
mapControl.Overlays.Add(mainOverlay);
clouds = new GMapImage(gtl);
clouds.Image = Properties.Resources.USOverlay;
mainOverlay.Markers.Add(clouds);
}
}
示例10: NavigationView
private double R = 6378137; // WGS-84;
public NavigationView(MainForm mainForm)
{
mf = mainForm;
InitializeComponent();
mainOverlay = new GMapOverlay(MainMap, "map");
MainMap.Overlays.Add(mainOverlay);
//routes = new GMapOverlay(MainMap, "routes");
//MainMap.Overlays.Add(routes);
Net = new GMapOverlay(MainMap, "net");
MainMap.Overlays.Add(Net);
track = new GMapOverlay(MainMap, "polygons");
MainMap.Overlays.Add(track);
objects = new GMapOverlay(MainMap, "objects");
MainMap.Overlays.Add(objects);
rulers = new GMapOverlay(MainMap, "rulers");
MainMap.Overlays.Add(rulers);
DistanceInfo = new GMapOverlay(MainMap, "DistanceInfo");
MainMap.Overlays.Add(DistanceInfo);
infolayers = new GMapOverlay(MainMap, "Info");
MainMap.Overlays.Add(infolayers);
WebNodeLayer = new GMapOverlay(MainMap, "webnode");
MainMap.Overlays.Add(WebNodeLayer);
g = MainMap.CreateGraphics();
}
示例11: OperationTj
public OperationTj(RMap mapcontrol)
: base(mapcontrol) {
routes = new GMapOverlay(mapcontrol, "qytj");
routes.Markers.CollectionChanged += new GMap.NET.ObjectModel.NotifyCollectionChangedEventHandler(Markers_CollectionChanged);
mapcontrol.Overlays.Add(routes);
}
示例12: Build
public static void Build(ref GMapOverlay OverlayOut)
{
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Display defined radars
//
string FileName = @"C:\ASTERIX\IMAGES\waypoint.jpg";
Image WaypointImage = Image.FromFile(FileName);
DisplayAttributes.DisplayAttributesType WaypointDisplayAttribute = DisplayAttributes.GetDisplayAttribute(DisplayAttributes.DisplayItemsType.Waypoint);
WaypointImage = GraphicUtilities.ResizeImage(WaypointImage, new Size(WaypointDisplayAttribute.ImageSize.Width, WaypointDisplayAttribute.ImageSize.Height), false);
// Here loop through defined waypoints and display them on the map
foreach (SystemAdaptationDataSet.Waypoint Waypoint in SystemAdaptationDataSet.WaypointDataSet)
{
// Image properties
GMapMarkerImage MyMarkerImage =
new GMapMarkerImage(new PointLatLng(Waypoint.WaypointPosition.GetLatLongDecimal().LatitudeDecimal, Waypoint.WaypointPosition.GetLatLongDecimal().LongitudeDecimal), WaypointImage);
MyMarkerImage.ToolTipMode = MarkerTooltipMode.Never;
System.Drawing.SolidBrush myBrush;
myBrush = new System.Drawing.SolidBrush(WaypointDisplayAttribute.TextColor);
WaypointMarker WPT_Marker = new WaypointMarker(new PointLatLng(Waypoint.WaypointPosition.GetLatLongDecimal().LatitudeDecimal, Waypoint.WaypointPosition.GetLatLongDecimal().LongitudeDecimal), Waypoint.WaypointName,
new Font(WaypointDisplayAttribute.TextFont, WaypointDisplayAttribute.TextSize, FontStyle.Regular, GraphicsUnit.Pixel), myBrush);
// Load marker to overlay
OverlayOut.Markers.Add(MyMarkerImage);
OverlayOut.Markers.Add(WPT_Marker);
}
}
示例13: Georefimage
public Georefimage()
{
InitializeComponent();
CHECK_AMSLAlt_Use.Checked = true;
PANEL_TIME_OFFSET.Enabled = false;
useAMSLAlt = CHECK_AMSLAlt_Use.Checked;
JXL_StationIDs = new List<int>();
selectedProcessingMode = PROCESSING_MODE.CAM_MSG;
MissionPlanner.Utilities.Tracking.AddPage(this.GetType().ToString(), this.Text);
myGMAP1.MapProvider = MainV2.instance.FlightData.gMapControl1.MapProvider;
myGMAP1.MinZoom = MainV2.instance.FlightData.gMapControl1.MinZoom;
myGMAP1.MaxZoom = MainV2.instance.FlightData.gMapControl1.MaxZoom;
GMapOverlay overlay = new GMapOverlay();
myGMAP1.Overlays.Add(overlay);
myGMAP1.OnMarkerClick += MyGMAP1_OnMarkerClick;
}
示例14: 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;
}
}
示例15: frmMapCar95
public frmMapCar95() {
InitializeComponent();
barButtonItem11.Alignment = DevExpress.XtraBars.BarItemLinkAlignment.Right;
btFullScrean.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
barSubItem1.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
rMap1 = new RMap();
rMap1.MouseWheelZoomType = MouseWheelZoomType.MousePositionWithoutCenter;
rMap1.Dock = DockStyle.Fill;
Controls.Add(rMap1);
mapview = rMap1;
rMap1.Manager.Mode = GMap.NET.AccessMode.ServerOnly;
GoogleChinaMap map = GoogleChinaMap.Instance;
map.TryCorrectVersion = false;
rMap1.MapProvider = map;
//rMap1.Position = new PointLatLng(46.6, 130);
rMap1.MaxZoom = 16;
rMap1.MinZoom = 9;
mapServer = ClientServer.PlatformServer.GetService<TONLI.MapCore.IMapServer>();
objects = new GMapOverlay(rMap1, "objects");
routes = new GMapOverlay(rMap1, "LineCode");
rMap1.Overlays.Add(routes);
rMap1.Overlays.Add(objects);
routes.Markers.CollectionChanged += new GMap.NET.ObjectModel.NotifyCollectionChangedEventHandler(Markers_CollectionChanged);
oInstances = new OperationInstances(rMap1);
curOperation = oInstances.LineOperation;
curOperation.CanEditMarker = true;
rMap1.OnMapZoomChanged += new MapZoomChanged(rMap1_OnMapZoomChanged);
rMap1.MouseEnter += new EventHandler(rMap1_MouseEnter);
rMap1.MouseMove += new MouseEventHandler(rMap1_MouseMove);
rMap1.MouseMove += new MouseEventHandler(MainMap_MouseMove);
rMap1.MouseDown += new MouseEventHandler(MainMap_MouseDown);
rMap1.MouseUp += new MouseEventHandler(MainMap_MouseUp);
rMap1.OnMarkerEnter += new MarkerEnter(MainMap_OnMarkerEnter);
rMap1.OnMarkerLeave += new MarkerLeave(MainMap_OnMarkerLeave);
rMap1.OnTileLoadStart += new TileLoadStart(MainMap_OnTileLoadStart);
rMap1.OnTileLoadComplete += new TileLoadComplete(MainMap_OnTileLoadComplete);
barButtonItem10.ButtonStyle = DevExpress.XtraBars.BarButtonStyle.Check;
barButtonItem10.AllowAllUp = true;
barButtonItem4.ButtonStyle = DevExpress.XtraBars.BarButtonStyle.Check;
barButtonItem4.DownChanged += new DevExpress.XtraBars.ItemClickEventHandler(测距_DownChanged);
barButtonItem10.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
//加载设备列表
ucLayerCar = new UCLayerCar();
ucLayerCar.Dock = DockStyle.Fill;
dockPanel1_Container.Controls.Add(ucLayerCar);
bxdh = new UCPJ_21gzbxdh();
bxdh.Dock = DockStyle.Fill;
dockPanel2_Container.Controls.Add(bxdh);
bxdh.OnBeginLocation += new ObjectEventHandler<PJ_21gzbxdh>(OnBeginLocation);
bxdh.OnTQLocation += new ObjectEventHandler<PJ_21gzbxdh>(bxdh_OnTQLocation);
this.WindowState = FormWindowState.Maximized;
btGzdj.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
}