本文整理汇总了C#中GMap.NET.WindowsForms.GMapControl类的典型用法代码示例。如果您正苦于以下问题:C# GMapControl类的具体用法?C# GMapControl怎么用?C# GMapControl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GMapControl类属于GMap.NET.WindowsForms命名空间,在下文中一共展示了GMapControl类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: MapAdapter
public MapAdapter(GMapControl mapControl)
{
_context = new WindowsFormsSynchronizationContext();
_mapControl = mapControl;
IObservable<Unit> positionChanged = Observable
.FromEvent<PositionChanged, PointLatLng>(
action => point => action(point),
handler => _mapControl.OnPositionChanged += handler,
handler => _mapControl.OnPositionChanged -= handler)
.Select(i => Unit.Default);
IObservable<Unit> mapZoom = Observable
.FromEvent<MapZoomChanged, Unit>(
action => () => action(Unit.Default),
handler => _mapControl.OnMapZoomChanged += handler,
handler => _mapControl.OnMapZoomChanged -= handler);
MapChanged = positionChanged
.Merge(mapZoom)
.ObserveOn(ThreadPoolScheduler.Instance);
mapControl.OnMapDrag += MapControl_OnMapDrag;
mapControl.OnPolygonClick += Control_OnPolygonClick;
}
开发者ID:nitbot,项目名称:MissionPlanner,代码行数:28,代码来源:MapAdapter.cs
示例2: GMapMarkerTarget
public GMapMarkerTarget(PointLatLng p, GMapControl map, Bitmap icon)
: base(p)
{
Size = SizeSt;
MainMap = map;
this.icon = icon;
}
开发者ID:JamesMasterman,项目名称:SeaScan,代码行数:7,代码来源:GMapMarkerTarget.cs
示例3: FeedMarker
public FeedMarker(PointLatLng loc, Article art, GMapControl gmap)
{
location = loc;
article = art;
this.gmap = gmap;
addPIN(location);
}
开发者ID:shank8,项目名称:CPTS-323,代码行数:7,代码来源:FeedMarker.cs
示例4: PloyLineOverLay
public PloyLineOverLay(GMapControl map, string layid)
: base(map, layid) {
control = map;
map.OnMarkerEnter += new MarkerEnter(map_OnMarkerEnter);
map.OnMarkerLeave += new MarkerLeave(map_OnMarkerLeave);
map.OnMapZoomChanged += new MapZoomChanged(map_OnMapZoomChanged);
}
开发者ID:s7loves,项目名称:mypowerscgl,代码行数:7,代码来源:PloyLineOverLay.cs
示例5: LineOverlay
public LineOverlay(GMapControl map, string lineCode)
: base(map, lineCode) {
map.OnMarkerEnter += new MarkerEnter(map_OnMarkerEnter);
map.OnMarkerLeave += new MarkerLeave(map_OnMarkerLeave);
map.OnMapZoomChanged += new MapZoomChanged(map_OnMapZoomChanged);
this.Markers.CollectionChanged += new GMap.NET.ObjectModel.NotifyCollectionChangedEventHandler(Markers_CollectionChanged);
control = map;
}
开发者ID:s7loves,项目名称:mypowerscgl,代码行数:8,代码来源:LineOverLay.cs
示例6: DrawPoint
public static void DrawPoint(GMapControl map, decimal latitude, decimal longitude)
{
GMapOverlay overlay = new GMapOverlay(map, "Stop");
overlay.Markers.Add(new GMap.NET.WindowsForms.Markers.GMapMarkerGoogleGreen(new PointLatLng((double)latitude, (double)longitude)));
map.Overlays.Add(overlay);
map.ZoomAndCenterMarkers(overlay.Id);
map.Zoom -= 2;
}
开发者ID:richardpianka,项目名称:Transit,代码行数:8,代码来源:MapUtilities.cs
示例7: DoDebug
static void DoDebug()
{
polygons = new GMapOverlay("polygons");
map = new GMapControl();
var form = new Form() { Size = new Size(1024, 768), WindowState = FormWindowState.Maximized };
map.Dock = DockStyle.Fill;
map.MapProvider = GMapProviders.GoogleSatelliteMap;
map.MaxZoom = 20;
map.Overlays.Add(polygons);
form.Controls.Add(map);
form.Show();
}
开发者ID:Event38,项目名称:MissionPlanner,代码行数:12,代码来源:Grid.cs
示例8: GoogleMap
private Main parent; // for SQL queries
#endregion Fields
#region Constructors
/// <summary>
/// Constructors GoogleMap and sets gmap and the parent.
/// Initialises the first overlay of the map.
/// </summary>
public GoogleMap(GMapControl gmap, Main parent)
{
if (gmap == null) throw new ArgumentNullException();
if (parent == null) throw new ArgumentNullException();
this.parent = parent;
this.gmap = gmap;
// overlay layer to add markers on the map
GMapOverlay overlay = new GMapOverlay("first_layer");
gmap.Overlays.Add(overlay);
}
开发者ID:TristanZeph,项目名称:QDMS_INB201,代码行数:22,代码来源:GoogleMap.cs
示例9: GMapOverlay
public GMapOverlay(GMapControl control, string id)
{
if(control == null)
{
throw new Exception("GMapControl in GMapOverlay can't be null");
}
Control = control;
Id = id;
Markers.CollectionChanged += new NotifyCollectionChangedEventHandler(Markers_CollectionChanged);
Routes.CollectionChanged += new NotifyCollectionChangedEventHandler(Routes_CollectionChanged);
Polygons.CollectionChanged += new NotifyCollectionChangedEventHandler(Polygons_CollectionChanged);
}
开发者ID:neolu,项目名称:MissionPlanner,代码行数:13,代码来源:GMapOverlay.cs
示例10: OnLoad
public override void OnLoad(GMapControl gMapControl)
{
_gMapControl = gMapControl;
_gMapControl.Overlays.Add(_gMapOverlay);
_points = new List<PointLatLng>();
_gMapControl.Overlays.Add(_gMapOverlay);
_gMapControl.Overlays.Add(_highLightOverlay);
_start = false;
_queryResultForm = new QueryResultForm();
this._mapUrl = ((SuperMapProvider)gMapControl.MapProvider).ServiceUrl;
this._mapName = ((SuperMapProvider)gMapControl.MapProvider).MapName;
InitLayers();
base.OnLoad(gMapControl);
}
开发者ID:SuperMap,项目名称:iClient-DotNet-Example,代码行数:15,代码来源:QueryByPolygonForm.cs
示例11: StaticImage
public StaticImage(GMapControl main)
{
InitializeComponent();
this.MainMap = main;
numericUpDown1.Maximum = MainMap.MaxZoom;
numericUpDown1.Minimum = MainMap.MinZoom;
numericUpDown1.Value = MainMap.Zoom;
bg.WorkerReportsProgress = true;
bg.WorkerSupportsCancellation = true;
bg.DoWork += new DoWorkEventHandler(bg_DoWork);
bg.ProgressChanged += new ProgressChangedEventHandler(bg_ProgressChanged);
bg.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bg_RunWorkerCompleted);
}
开发者ID:wrbrooks,项目名称:VB3,代码行数:16,代码来源:StaticImage.cs
示例12: MapPrintPreviewForm
public MapPrintPreviewForm(GMapControl ctrlGMap)
: this()
{
#region Create Map copied
gMap.Manager.Mode = AccessMode.ServerOnly;
gMap.MinZoom = ctrlGMap.MinZoom;
gMap.MaxZoom = ctrlGMap.MaxZoom;
gMap.Zoom = ctrlGMap.Zoom;
gMap.Position = ctrlGMap.Position;
gMap.MouseWheelZoomEnabled = ctrlGMap.MouseWheelZoomEnabled;
gMap.MouseWheelZoomType = ctrlGMap.MouseWheelZoomType;
gMap.EmptyTileColor = System.Drawing.Color.Aquamarine;
gMap.GrayScaleMode = true;
gMap.Manager.UsePlacemarkCache = false;
gMap.ConnectionString = (ctrlGMap is CustomGMapControl)
? ((CustomGMapControl)ctrlGMap).ConnectionString
: null;
gMap.OnTileLoadComplete += GMap_OnTileLoadComplete;
gMap.OnTileLoadStart += GMap_OnTileLoadStart;
gMap.Manager.UseMemoryCache = true;
//gMap.Manager.CancelTileCaching();
foreach (GMapOverlay overlay in ctrlGMap.Overlays)
{
foreach (var marker in overlay.Markers)
{
gMap.AddMarker(marker);
}
foreach (var route in overlay.Routes)
{
var r = new GMapRoute(route.Name);
r.Points.AddRange(route.Points);
r.Stroke = route.Stroke;
gMap.AddRoute(r);
}
gMap.SetMapBound();
}
#endregion
}
开发者ID:Behzadkhosravifar,项目名称:greatmaps,代码行数:45,代码来源:MapPrintPreviewForm.cs
示例13: DrawMap
public static void DrawMap(GMapControl map, List<Point> points, Color color, bool includeMarkers)
{
Pen pen = new Pen(color, 3.0f);
List<PointLatLng> allMapPoints = points.Select(point => new PointLatLng(point.Latitude, point.Longitude)).ToList();
GMapRoute route = new GMapRoute(allMapPoints, "Route");
route.Stroke = pen;
map.ZoomAndCenterRoute(route);
GMapOverlay overlay = new GMapOverlay(map, "Overlay");
if (includeMarkers)
{
overlay.Markers.Add(new GMap.NET.WindowsForms.Markers.GMapMarkerGoogleGreen(new PointLatLng(allMapPoints.First().Lat, allMapPoints.First().Lng)));
overlay.Markers.Add(new GMap.NET.WindowsForms.Markers.GMapMarkerGoogleRed(new PointLatLng(allMapPoints.Last().Lat, allMapPoints.Last().Lng)));
}
overlay.Routes.Add(route);
map.Overlays.Add(overlay);
}
开发者ID:richardpianka,项目名称:Transit,代码行数:18,代码来源:MapUtilities.cs
示例14: GMapMarkerWind
public GMapMarkerWind(PointLatLng p, GMapControl map, float bearing, float speed)
: base(p)
{
Size = SizeSt;
MainMap = map;
this.bearing = bearing;
this.speed = speed;
if (speed > ORANGE_SPEED_LIMIT)
{
icon = global::SeaScanUAV.Properties.Resources.Orange_N;
}
else if (speed > RED_SPEED_LIMIT)
{
icon = global::SeaScanUAV.Properties.Resources.Red_N;
}
}
开发者ID:JamesMasterman,项目名称:SeaScan,代码行数:18,代码来源:GMapMarkerWind.cs
示例15: GMapRestImagery
public GMapRestImagery()
{
//_baseUri = baseUri;
_levels = new RasterLevel[NumberOfLevels];
_levelsCollection = new RasterLevelCollection(_levels);
double deltaLongitude = LevelZeroDeltaLongitudeDegrees;
double deltaLatitude = LevelZeroDeltaLatitudeDegrees;
for (int i = 0; i < _levels.Length; ++i)
{
int longitudePosts = (int)Math.Round(360.0 / deltaLongitude) * TileLongitudePosts + 1;
int latitudePosts = (int)Math.Round(180 / deltaLatitude) * TileLatitudePosts + 1;
_levels[i] = new RasterLevel(this, i, _extent, longitudePosts, latitudePosts, TileLongitudePosts, TileLatitudePosts);
deltaLongitude /= 2.0;
deltaLatitude /= 2.0;
}
MainMap = new GMapControl();
MainMap.MapType = GMap.NET.MapType.GoogleSatellite;
MainMap.CacheLocation = Path.GetDirectoryName(Application.ExecutablePath) + "/gmapcache/";
}
开发者ID:CJBlake,项目名称:ardupilotone,代码行数:23,代码来源:temp.cs
示例16: Form1_Load
private void Form1_Load(object sender, EventArgs e)
{
MainMap = new GMapControl();
MainMap.MapProvider = GMapProviders.OpenStreetMap;
MainMap.Position = new PointLatLng(50.619900, 26.251617);
MainMap.MinZoom = 3;
MainMap.MaxZoom = 20;
MainMap.Zoom = 9;
MainMap.Dock = DockStyle.Fill;
MainMap.MarkersEnabled = true;
MainMap.PolygonsEnabled = true;
MainMap.RoutesEnabled = true;
MainMap.MouseClick += MainMap_MouseClick;
MainMap.OnMarkerClick += MainMap_OnMarkerClick;
//MainMap.OnPositionChanged += MainMap_OnPositionChanged;
Controls.Add(MainMap);
sl = new TrackBar();
sl.Orientation = Orientation.Vertical;
sl.TickStyle = TickStyle.Both;
sl.TickFrequency = 10;
sl.Maximum = 100;
sl.Minimum = 1;
sl.Value = (int)((MainMap.Zoom - MainMap.MinZoom)/ MainMap.MaxZoom * sl.Maximum);
sl.Height = this.Height / 3;
sl.Width = 50;
sl.Location = new Point(MainMap.Width - sl.Width - 5, MainMap.Height - sl.Height -10);
sl.ValueChanged += sl_ValueChanged;
Controls.Add(sl);
sl.BringToFront();
markersOverlay = new GMapOverlay("markers");
routeOverlay = new GMapOverlay("routes");
isAddMarker = true;
}
开发者ID:vadimvoyevoda,项目名称:NetworkProgramming,代码行数:36,代码来源:Form1.cs
示例17: DoDebug
static void DoDebug()
{
if (map != null)
{
if (map.Overlays.Count != 0)
{
while (polygons.Markers.Count > 7)
polygons.Markers.RemoveAt(0);
//polygons.Markers.Clear();
return;
}
}
polygons = new GMapOverlay("polygons");
map = new GMapControl();
var form = new Form() { Size = new Size(1024, 768), WindowState = FormWindowState.Maximized };
map.Dock = DockStyle.Fill;
map.MapProvider = GMapProviders.GoogleSatelliteMap;
map.MaxZoom = 20;
map.Overlays.Add(polygons);
form.Controls.Add(map);
form.Show();
}
开发者ID:moon-siama,项目名称:MissionPlanner,代码行数:23,代码来源:ImageProjection.cs
示例18: assignMapToUpdate
public void assignMapToUpdate(GMapControl map)
{
_map = map;
}
开发者ID:yuyutak,项目名称:PokemonGo-Bot-SimpleGUI,代码行数:4,代码来源:HumanWalking.cs
示例19: BUT_geinjection_Click
private void BUT_geinjection_Click(object sender, EventArgs e)
{
GMapControl MainMap = new GMapControl();
MainMap.MapType = GMap.NET.MapType.GoogleSatellite;
MainMap.CacheLocation = Path.GetDirectoryName(Application.ExecutablePath) + "/gmapcache/";
FolderBrowserDialog fbd = new FolderBrowserDialog();
try
{
fbd.SelectedPath = @"C:\Users\hog\Documents\albany 2011\New folder";
}
catch { }
fbd.ShowDialog();
if (fbd.SelectedPath != "") {
string[] files = Directory.GetFiles(fbd.SelectedPath,"*.jpg",SearchOption.AllDirectories);
foreach (string file in files)
{
log.Info(DateTime.Now.Millisecond + " Doing "+ file);
Regex reg = new Regex(@"Z([0-9]+)\\([0-9]+)\\([0-9]+)");
Match mat = reg.Match(file);
int temp = 1 << int.Parse(mat.Groups[1].Value);
GMap.NET.GPoint pnt = new GMap.NET.GPoint(int.Parse(mat.Groups[3].Value), int.Parse(mat.Groups[2].Value));
BUT_geinjection.Text = file;
BUT_geinjection.Refresh();
//MainMap.Projection.
MemoryStream tile = new MemoryStream();
Image Img = Image.FromFile(file);
Img.Save(tile,System.Drawing.Imaging.ImageFormat.Jpeg);
tile.Seek(0, SeekOrigin.Begin);
log.Info(pnt.X + " " + pnt.Y);
Application.DoEvents();
MainMap.Manager.ImageCacheLocal.PutImageToCache(tile, GMap.NET.MapType.Custom, pnt, int.Parse(mat.Groups[1].Value));
Application.DoEvents();
}
}
}
开发者ID:porty,项目名称:ardupilot-mega-terminator,代码行数:53,代码来源:temp.cs
示例20: BUT_clearcustommaps_Click
private void BUT_clearcustommaps_Click(object sender, EventArgs e)
{
GMapControl MainMap = new GMapControl();
MainMap.MapType = GMap.NET.MapType.GoogleSatellite;
MainMap.CacheLocation = Path.GetDirectoryName(Application.ExecutablePath) + "/gmapcache/";
int removed = ((GMap.NET.CacheProviders.SQLitePureImageCache)MainMap.Manager.ImageCacheLocal).DeleteOlderThan(DateTime.Now, GMap.NET.MapType.Custom);
CustomMessageBox.Show("Removed "+removed + " images\nshrinking file next");
GMap.NET.CacheProviders.SQLitePureImageCache.VacuumDb(MainMap.CacheLocation + @"\TileDBv3\en\Data.gmdb");
log.InfoFormat("Removed {0} images", removed);
}
开发者ID:porty,项目名称:ardupilot-mega-terminator,代码行数:15,代码来源:temp.cs
注:本文中的GMap.NET.WindowsForms.GMapControl类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论