本文整理汇总了C#中GMap.NET.PointLatLng类的典型用法代码示例。如果您正苦于以下问题:C# PointLatLng类的具体用法?C# PointLatLng怎么用?C# PointLatLng使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PointLatLng类属于GMap.NET命名空间,在下文中一共展示了PointLatLng类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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;
}
示例2: getDistance
public double getDistance(PointLatLng p1, PointLatLng p2)
{
GMapRoute route = new GMapRoute("getDistance");
route.Points.Add(p1);
route.Points.Add(p2);
double distance = route.Distance;
route.Clear();
route = null;
return distance;
}
示例3: getLatLong
private PointLatLng getLatLong(PointD i_location)
{
PointLatLng coordinates;
coordinates = new PointLatLng(i_location.X, i_location.Y);
return coordinates;
}
示例4: button1_Click_1
private void button1_Click_1(object sender, EventArgs e)
{
double lat1 = Double.Parse(textBox_latitude1.Text);
double lon1 = Double.Parse(textBox_longitude1.Text);
double lat2 = Double.Parse(textBox_latitude2.Text);
double lon2 = Double.Parse(textBox_longitude2.Text);
double lat3 = Double.Parse(textBox_latitude3.Text);
double lon3 = Double.Parse(textBox_longitude3.Text);
double lat4 = Double.Parse(textBox_latitude4.Text);
double lon4 = Double.Parse(textBox_longitude4.Text);
PointLatLng p1 = new PointLatLng(lat1, lon1);
PointLatLng p2 = new PointLatLng(lat2, lon2);
PointLatLng p3 = new PointLatLng(lat3, lon3);
PointLatLng p4 = new PointLatLng(lat4, lon4);
FlightPlanner.instance.polygongridmode = true;
FlightPlanner.instance.drawnpolygon.Points.Add(p1);
FlightPlanner.instance.drawnpolygon.Points.Add(p2);
FlightPlanner.instance.drawnpolygon.Points.Add(p3);
FlightPlanner.instance.drawnpolygon.Points.Add(p4);
FlightPlanner.instance.drawnpolygonsoverlay.Polygons.Add(FlightPlanner.instance.drawnpolygon);
/*List<PointLatLng> points = new List<PointLatLng>();
PointLatLng p1 = new PointLatLng(lat1, lon1);
PointLatLng p2 = new PointLatLng(lat2, lon2);
PointLatLng p3 = new PointLatLng(lat3, lon3);
PointLatLng p4 = new PointLatLng(lat4, lon4);
points.Add(p1);
points.Add(p2);
points.Add(p3);
points.Add(p4);
GMap.NET.WindowsForms.GMapPolygon test = new GMap.NET.WindowsForms.GMapPolygon(points, "yolo");
test.IsVisible = true;*/
}
示例5: GMapMarkerGzbx
public GMapMarkerGzbx(PointLatLng p)
: base(p) {
Image = Resources.marker;
ImageShadow = Resources.shadow50;
Size = SizeSt = new Size(Image.Width, Image.Height);
Offset = new Point(-10, -34);
}
示例6: GMapMarkerBDZ
public GMapMarkerBDZ(PointLatLng p)
: base(p) {
Size = SizeSt = new Size(20, 20);
Offset = new Point(-10, -10);
Text = string.Empty;
mFont = new Font(FontFamily.GenericSansSerif, 10, FontStyle.Bold);
}
示例7: RectLatLng
public RectLatLng(PointLatLng location, SizeLatLng size)
{
this.lng = location.Lng;
this.lat = location.Lat;
this.widthLng = size.WidthLng;
this.heightLat = size.HeightLat;
}
示例8: CustomMarker
/// <summary>
/// Constructor
/// </summary>
/// <param name="p">The position of the marker</param>
public CustomMarker(PointLatLng p, Image image)
: base(p)
{
img = image;
Size = img.Size;
Offset = new System.Drawing.Point(-Size.Width / 2, -Size.Height / 2);
}
示例9: GMapMarkerBYQ
public GMapMarkerBYQ(PointLatLng p)
: base(p) {
Size=SizeSt = new Size(15, 10);
Offset = new Point(-7, -5);
Text = string.Empty;
mFont = new Font(FontFamily.GenericSansSerif, 8, FontStyle.Bold);
}
示例10: FindNearestMarker
public static GMapMarker FindNearestMarker(this Collection<GMapMarker> source, PointLatLng point, Func<PointLatLng, PointLatLng, double> getDistance)
{
GMapMarker nearestMarker = null;
double smallestDistance = double.PositiveInfinity;
foreach (var marker in source)
{
if (marker.Position != point)
{
var distance = getDistance(marker.Position, point);
if (distance < smallestDistance)
{
smallestDistance = distance;
nearestMarker = marker;
}
}
}
if(double.IsPositiveInfinity(smallestDistance))
{
return null;
}
else
{
return nearestMarker;
}
}
示例11: GMapMarkerRect
public GMapMarkerRect(PointLatLng p)
: base(p)
{
Pen.DashStyle = DashStyle.Dot;
Size = new System.Drawing.Size(50, 50);
Offset = new System.Drawing.Point(-Size.Width / 2, -Size.Height / 2 - 20);
}
示例12: FeedMarker
public FeedMarker(PointLatLng loc, Article art, GMapControl gmap)
{
location = loc;
article = art;
this.gmap = gmap;
addPIN(location);
}
示例13: GMapMarkerImage
private Image img; /// <summary>
#endregion Fields
#region Constructors
/// <summary>
/// Constructor
/// </summary>
/// <param name="p">The position of the marker</param>
public GMapMarkerImage(PointLatLng p, Image image)
: base(p)
{
img = image;
Size = img.Size;
Offset = new System.Drawing.Point(-Size.Width, Size.Height / 7);
}
示例14: GMapCustomImageMarkerYellow
public GMapCustomImageMarkerYellow(PointLatLng p)
: base(p)
{
image = Image.FromFile("img/point_y.png");
Size = new System.Drawing.Size(image.Width, image.Height);
Offset = new Point( - (image.Width / 2), - (image.Height / 2));
}
示例15: BuildLineGT
/// <summary>
/// 创建线路杆塔点标记
/// </summary>
/// <param name="LineCode"></param>
/// <returns></returns>
static public List<GMapMarkerVector> BuildLineGT(string LineCode, string LineName) {
IList<PS_gt> list = Client.ClientHelper.PlatformSqlMap.GetList<PS_gt>(string.Format("where Linecode='{0}' order by gtcode", LineCode));
List<GMapMarkerVector> markers = new List<GMapMarkerVector>();
GMapMarkerVector marker = null;
GMapMarkerVector preMarker = null;
foreach (PS_gt gt in list) {
PointF pf = new PointF((float)gt.gtLon, (float)gt.gtLat);
if (box.Contains(pf)) {
PointLatLng point = new PointLatLng(Convert.ToDouble(gt.gtLat), Convert.ToDouble(gt.gtLon));
if (gt.gtType.Contains("方杆"))
marker = new GMapMarkerRect(point);
else
marker = new GMapMarkerVector(point);
if (preMarker != null) {
marker.ParentMarker = preMarker;
preMarker.NextMarker = marker;
}
preMarker = marker;
marker.ToolTipText = gt.gth + "\n" + LineName;
marker.Tag = gt;
markers.Add(marker);
}
}
return markers;
}