当前位置: 首页>>代码示例>>C#>>正文


C# PointLatLng.ToString方法代码示例

本文整理汇总了C#中GMap.NET.PointLatLng.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# PointLatLng.ToString方法的具体用法?C# PointLatLng.ToString怎么用?C# PointLatLng.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GMap.NET.PointLatLng的用法示例。


在下文中一共展示了PointLatLng.ToString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: wAddMarkerDialog

 public wAddMarkerDialog(PointLatLng coordPoint)
 {
     InitializeComponent();
     this.CoordPoint = coordPoint;
     lCoords.Content = CoordPoint.ToString();
 }
开发者ID:koorool,项目名称:SSMA,代码行数:6,代码来源:wAddMarkerDialog.xaml.cs

示例2: PinPointsOnMap

        private void PinPointsOnMap(PointLatLng latLong)
        {
            GMapMarker m = new GMapMarker(latLong);
            {
                Placemark p = null;
                {
                    GeoCoderStatusCode status;
                    var plret = GMapProviders.GoogleMap.GetPlacemark(latLong, out status);
                    if (status == GeoCoderStatusCode.G_GEO_SUCCESS && plret != null)
                    {
                        p = plret;
                    }
                }

                string ToolTipText;
                if (p != null)
                {
                    ToolTipText = p.Address;
                }
                else
                {
                    ToolTipText = latLong.ToString();
                }

                m.Shape = new PinMarker(this, m, ToolTipText);
                m.ZIndex = 55;
            }

            transporterMap.Markers.Add(m);
        }
开发者ID:nixonchakiath,项目名称:Spotter,代码行数:30,代码来源:MapControl.xaml.cs

示例3: Window_MouseDoubleClick

        private void Window_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            System.Windows.Point point = e.GetPosition(MainMap);
            PointLatLng latlog = new PointLatLng();
            latlog = MainMap.FromLocalToLatLng((int)point.X, (int)point.Y);
            {   //latlog list for routing support
                selectedPoint = latlog;
                RoutePoints.Add(latlog);
            }

            GMapMarker m = new GMapMarker(latlog);
            {
                Placemark p = null;
                //if (checkBoxPlace.IsChecked.Value)
                { //for get place information
                    GeoCoderStatusCode status;
                    var plret = GMapProviders.GoogleMap.GetPlacemark(latlog, out status);
                    if (status == GeoCoderStatusCode.G_GEO_SUCCESS && plret != null)
                    {
                        p = plret;
                    }
                }

                string ToolTipText;
                if (p != null)
                {
                    ToolTipText = p.Address;
                }
                else
                {
                    ToolTipText = latlog.ToString();
                }

                m.Shape = new PinMarker(this, m, ToolTipText);
                m.ZIndex = 55;
            }

            MainMap.Markers.Add(m);
        }
开发者ID:nixonchakiath,项目名称:Spotter,代码行数:39,代码来源:MainWindow.xaml.cs

示例4: OnBuildingDescriptionPropertyChanged

        private static void OnBuildingDescriptionPropertyChanged(DependencyObject source,
            DependencyPropertyChangedEventArgs e)
        {
            SmartGMapControl smartGMapControl = source as SmartGMapControl;
              if (smartGMapControl != null)
              {
            if (smartGMapControl.MapProvider == null || smartGMapControl.MapProvider == GMapProviders.EmptyProvider)
            {
              smartGMapControl.MapProvider = smartGMapControl.GetMapProvider;//.OpenStreetMap;
              smartGMapControl.Manager.Mode = AccessMode.ServerAndCache;
              smartGMapControl.Position = new PointLatLng(51.3458053, 19.3458053);
            }
            if (smartGMapControl.MapProvider != null && smartGMapControl.MapProvider != GMapProviders.EmptyProvider)
            {
            GeoCoderStatusCode status = GeoCoderStatusCode.Unknow;

            PointLatLng? city = GMapProviders.GoogleMap.GetPoint(e.NewValue.ToString(), out status);
            if(city != null && status == GeoCoderStatusCode.G_GEO_SUCCESS)
            {
              RoutingProvider rp = smartGMapControl.MapProvider as RoutingProvider;
              if (rp == null)
              {
                rp = GMapProviders.GoogleMap; // use google if provider does not implement routing
              }

              PointLatLng start = new PointLatLng(51.3458053, 19.3458053);
              PointLatLng end = city.Value;
              MapRoute route = rp.GetRoute(start, end, false, false, (int)smartGMapControl.Zoom);
              if (route != null)
              {
                smartGMapControl.RouteDistance = route.Distance;
                GMapMarker m1 = new GMapMarker(start);
                m1.Shape = new CustomMarkerRed(smartGMapControl, m1, "Start: " + route.Name);
                m1.ZIndex = 10;

                GMapMarker m2 = new GMapMarker(end);
                m2.Shape = new CustomMarkerRed(smartGMapControl, m2, "End: " + start.ToString());
                m2.ZIndex = 10;

                GMapMarker mRoute = new GMapMarker(start);
                {
                  mRoute.Route.AddRange(route.Points);
                  mRoute.RegenerateRouteShape(smartGMapControl);

                  mRoute.ZIndex = 10;
                }

                smartGMapControl.Markers.Clear();
                smartGMapControl.Markers.Add(m1);
                smartGMapControl.Markers.Add(m2);
                smartGMapControl.Markers.Add(mRoute);

                //RectLatLng? rectLatLng = smartGMapControl.GetRectOfAllMarkers(null);
                //if (rectLatLng.HasValue)
                //{
                //  smartGMapControl.Position = new PointLatLng(rectLatLng.Value.Lat + rectLatLng.Value.HeightLat / 2,
                //                                              rectLatLng.Value.Lng + rectLatLng.Value.WidthLng / 2);
                //}
                //smartGMapControl.ZoomAndCenterMarkers(null);

              }

              //List<PointLatLng> rt = new List<PointLatLng>(); // is a List<PointLatLng>
              //rt.Add(new PointLatLng(51.3458053, 19.3458053));
              //rt.Add(city.Value);
              //MapRoute routes = new MapRoute(rt, "MyRoute");

              //if (routes != null)
              //{
              //  //GMapRoute r = new GMapRoute(routes.Points, routes.Name);
              //  //r.Stroke.Color = Color.Red;
              //  //routes.Routes.Add(r);

              //  GMapMarker it1 = new GMapMarker((PointLatLng)routes.From.Value);
              //  it1.Shape = new CustomMarkerRed(smartGMapControl, it1, "from");
              // // m1.ToolTipText = "From";
              //  GMapMarker it2 = new GMapMarker((PointLatLng)routes.To.Value);
              //  it2.Shape = new CustomMarkerRed(smartGMapControl, it2, "to");
              ////  m2.ToolTipText = "To";

              //  smartGMapControl.Markers.Add(it1);
              //  smartGMapControl.Markers.Add(it2);

              //  GMapRoute r = new GMapRoute(route.Points, "test");
              //  smartGMapControl.ZoomAndCenterMarkers(null);
              //}

              //GMapMarker it = new GMapMarker(city.Value);
              //{
              //  it.ZIndex = 55;
              //  it.Shape = new CustomMarkerRed(smartGMapControl, it, "Welcome to Lithuania! ;}");
              //}
              //smartGMapControl.Markers.Add(it);
              //smartGMapControl.ReloadMap();
            }
            }
              }
        }
开发者ID:adamnowak,项目名称:SmartWorking,代码行数:98,代码来源:SmartGMapControl.cs


注:本文中的GMap.NET.PointLatLng.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。