• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# CLLocationCoordinate2D类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中CLLocationCoordinate2D的典型用法代码示例。如果您正苦于以下问题:C# CLLocationCoordinate2D类的具体用法?C# CLLocationCoordinate2D怎么用?C# CLLocationCoordinate2D使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



CLLocationCoordinate2D类属于命名空间,在下文中一共展示了CLLocationCoordinate2D类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: BasicPinAnnotation

			public BasicPinAnnotation (CLLocationCoordinate2D coordinate, string title, string subtitle, string imageAdress) 
			{
				this.Coords = coordinate;
				this.title = title;
				this.subtitle = subtitle;
				this.imageAdress = imageAdress;
			}
开发者ID:kosomgua,项目名称:MapCross,代码行数:7,代码来源:BasicPinAnnotation.cs


示例2: FieldMapAnnotation

 public FieldMapAnnotation(Field field)
 {
     coordinate = new CLLocationCoordinate2D(GeoHelper.CalculateCenter(field.BoundingCoordinates).Latitude, GeoHelper.CalculateCenter(field.BoundingCoordinates).Longitude);
     Field = field;
     title = field.Name;
     subtitle = string.Format("Number of blocks: {0}", field.Blocks.Count);
 }
开发者ID:MilenPavlov,项目名称:treewatch,代码行数:7,代码来源:FieldMapAnnotation.cs


示例3: ViewDidLoad

		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();
			
			Title = "MapView";
			
			mapView = new MKMapView(View.Bounds);	
			mapView.AutoresizingMask = UIViewAutoresizing.FlexibleDimensions;		
			//mapView.MapType = MKMapType.Standard;	// this is the default
			//mapView.MapType = MKMapType.Satellite;
			//mapView.MapType = MKMapType.Hybrid;
			View.AddSubview(mapView);

			// create our location and zoom 
			//CLLocationCoordinate2D coords = new CLLocationCoordinate2D(40.77, -73.98); // new york
			//CLLocationCoordinate2D coords = new CLLocationCoordinate2D(33.93, -118.40); // los angeles
			//CLLocationCoordinate2D coords = new CLLocationCoordinate2D(51.509, -0.1); // london
			CLLocationCoordinate2D coords = new CLLocationCoordinate2D(48.857, 2.351); // paris

			MKCoordinateSpan span = new MKCoordinateSpan(MilesToLatitudeDegrees(20), MilesToLongitudeDegrees(20, coords.Latitude));
			
			// set the coords and zoom on the map
			mapView.Region = new MKCoordinateRegion(coords, span);

		}
开发者ID:eduardoguilarducci,项目名称:recipes,代码行数:25,代码来源:MapViewController.cs


示例4: ConferenceAnnotation

 /// <summary>
 /// custom constructor
 /// </summary>
 public ConferenceAnnotation(CLLocationCoordinate2D coord, string t, string s)
     : base()
 {
     _coordinate=coord;
      	_title=t;
     _subtitle=s;
 }
开发者ID:megsoftconsulting,项目名称:MonkeySpace,代码行数:10,代码来源:MapViewController.cs


示例5: ExtendedMapAnnotation

 public ExtendedMapAnnotation(CLLocationCoordinate2D coordinate, string title, string subtitle, string pinIcon)
 {
   _coordinate = coordinate;
   _title = title;
   _subtitle = subtitle;
   _pinIcon = pinIcon;
 }
开发者ID:patridge,项目名称:Xamarin.Forms.Plugins,代码行数:7,代码来源:ExtendedMapAnnotation.cs


示例6: LoadMarkers

        public void LoadMarkers()
        {
            CLLocationCoordinate2D coord;

            string[] coordList = ReadGPSCoords ();

            foreach (string s in coordList) {

                if (string.IsNullOrEmpty (s) == false) {

                    string[] coordPair = s.Split(',');

                    if (coordPair.Length > 0) {

                        var longitude = coordPair [0];
                        var lat = coordPair [1];

                        coord = new CLLocationCoordinate2D ( Convert.ToDouble(lat), Convert.ToDouble(longitude));
                        var marker = Marker.FromPosition (coord);
                        marker.Map = mapView;
                    }

                }

            }
        }
开发者ID:ChuBaka13321,项目名称:customer-success-samples,代码行数:26,代码来源:FirstViewController.cs


示例7: ViewDidLoad

		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();
			
			// Perform any additional setup after loading the view, typically from a nib.

			//change map type and show user location
			//mapView.MapType = MonoTouch.MapKit.MKMapType.Hybrid;
			mapView.ShowsUserLocation = true;

			//set map center and region
			double lat = 45.8149;
			double lon = 15.9785;
			var mapCenter = new CLLocationCoordinate2D (lat,lon);
			var mapRegion = MKCoordinateRegion.FromDistance (mapCenter, 2000, 2000);
			mapView.CenterCoordinate = mapCenter;
			mapView.Region = mapRegion;


			//set the map delegate -> callback
			//mapView will call this when something needs to be done (extras ...)
			MapViewDelegate mvd = new MapViewDelegate();
			mapView.Delegate = mvd;

			//It's important that the map delegate is created before annotations!!
			//add an annotation MKPointAnnotation -> basic class
			mapView.AddAnnotation (new MKPointAnnotation (){Title="MyAnnotation",Coordinate = new CLLocationCoordinate2D(45.8100,15.9760)});
			//add an annotation MyCustomAnnotation -> custom class
			mapView.AddAnnotation (new MyCustomAnnotation("HolisticWare","www.holisticware.com",new CLLocationCoordinate2D(45.8090,15.9710)));

			//add an overlay
			var circleOverlay = MKCircle.Circle (mapCenter, 1000);
			mapView.AddOverlay (circleOverlay);

		}
开发者ID:moljac,项目名称:MonoTouch.Samples,代码行数:35,代码来源:MapDemoViewController.cs


示例8: RestaurantAnnotation

 public RestaurantAnnotation (string title, string subtitle, CLLocationCoordinate2D coordinate, RestaurantKind kind)
 {
     _title = title;
     _subtitle = subtitle;
     _coordinate = coordinate;
     _kind = kind;
 }
开发者ID:enricos,项目名称:learning_monotouch_code,代码行数:7,代码来源:RestaurantAnnotation.cs


示例9: ViewDidLoad

        public override void ViewDidLoad()
        {
            Console.WriteLine("Map to load");
            base.ViewDidLoad ();

            Title = "MapView";

            //mapView = new MKMapView(View.Bounds);
            this.DDZMapView.AutoresizingMask = UIViewAutoresizing.FlexibleDimensions;
            //this.DDZMapView.MapType = MKMapType.Standard;	// this is the default
            //this.DDZMapView.MapType = MKMapType.Satellite;
            //this.DDZMapView.MapType = MKMapType.Hybrid;
            View.AddSubview(this.DDZMapView);

            // create our location and zoom
            CLLocationCoordinate2D coords = new CLLocationCoordinate2D(38.9686111, -77.3413889); // Reston
            MKCoordinateSpan span = new MKCoordinateSpan(MilesToLatitudeDegrees(2), MilesToLongitudeDegrees(2, coords.Latitude));

            // set the coords and zoom on the map
            this.DDZMapView.Region = new MKCoordinateRegion(coords, span);

            circleOverlay = MKCircle.Circle (coords, 200);
            this.DDZMapView.AddOverlay (circleOverlay);

            this.DDZMapView.GetViewForOverlay = (m, o) => {
                if(circleView == null)
                {
                    circleView = new MKCircleView(o as MKCircle);
                    circleView.FillColor = UIColor.Purple;
                    circleView.Alpha = 0.5f;
                }
                return circleView;
            };
        }
开发者ID:FabG,项目名称:XploreLite,代码行数:34,代码来源:DataDistZipController.cs


示例10: ViewDidLoad

        public override void ViewDidLoad ()
        {
            base.ViewDidLoad ();

            // change map type and show user location
            map.MapType = MKMapType.Hybrid;
            map.ShowsUserLocation = true;

            // set map center and region
            double lat = 42.374260;
            double lon = -71.120824;
            var mapCenter = new CLLocationCoordinate2D (lat, lon);
            var mapRegion = MKCoordinateRegion.FromDistance (mapCenter, 2000, 2000);
            map.CenterCoordinate = mapCenter;
            map.Region = mapRegion;

            // add an annotation
            map.AddAnnotation (new MKPointAnnotation (){Title="MyAnnotation", Coordinate = new CLLocationCoordinate2D (42.364260, -71.120824)});

            // set the map delegate
            mapDel = new MyMapDelegate ();
            map.Delegate = mapDel;

            // add a custom annotation
            map.AddAnnotation (new MonkeyAnnotation ("Xamarin", mapCenter));

            // add an overlay
            var circleOverlay = MKCircle.Circle (mapCenter, 1000);
            map.AddOverlay (circleOverlay);
        }
开发者ID:GSerjo,项目名称:Seminars,代码行数:30,代码来源:MapDemoViewController.cs


示例11: ViewDidLoad

		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();
			
			Title = "Highland Park, Los Angeles";
			
			// create our location and zoom for los angeles
			CLLocationCoordinate2D coords = new CLLocationCoordinate2D (34.120, -118.188);
			MKCoordinateSpan span = new MKCoordinateSpan(MilesToLatitudeDegrees (20), MilesToLongitudeDegrees (20, coords.Latitude));

			// set the coords and zoom on the map
			mapMain.Region = new MKCoordinateRegion (coords, span);
			
			// set our delegate. we don't actually need a delegate if we want to just drop a pin
			// on there, but if we want to specify anything custom, we do
			mapMain.Delegate = new MapDelegate();
			
			// add a basic annotation
			mapMain.AddAnnotation (new BasicMapAnnotation (new CLLocationCoordinate2D (34.120, -118.188), "Los Angeles", "City of Demons"));
			
			// can use this as well.
//			mapMain.AddAnnotationObject(
//				new BasicMapAnnotationProto() { Coordinate = new CLLocationCoordinate2D(34.120, -118.188), Title = "Los Angeles", Subtitle = "City of Demons" }
//			);
		}
开发者ID:Adameg,项目名称:mobile-samples,代码行数:25,代码来源:AnnotatedMapScreen.xib.cs


示例12: OnElementChanged

        protected override void OnElementChanged(ElementChangedEventArgs<View> e)
        {
            base.OnElementChanged (e);

            if (e.OldElement != null) {
                var nativeMap = Control as MKMapView;
                nativeMap.OverlayRenderer = null;
            }

            if (e.NewElement != null) {
                var formsMap = (CustomMap)e.NewElement;
                var nativeMap = Control as MKMapView;

                nativeMap.OverlayRenderer = GetOverlayRenderer;

                CLLocationCoordinate2D[] coords = new CLLocationCoordinate2D[formsMap.ShapeCoordinates.Count];

                int index = 0;
                foreach (var position in formsMap.ShapeCoordinates) {
                    coords [index] = new CLLocationCoordinate2D (position.Latitude, position.Longitude);
                    index++;
                }

                var blockOverlay = MKPolygon.FromCoordinates (coords);
                nativeMap.AddOverlay (blockOverlay);
            }
        }
开发者ID:yofanana,项目名称:recipes,代码行数:27,代码来源:CustomMapRenderer.cs


示例13: HouseMapAnnotation

		public HouseMapAnnotation (CLLocationCoordinate2D coordinate, string title, House house, string rank) {
			this.coordinate = coordinate;
			this.title = title;
			this.House = house;
			this.subtitle = string.Format ("({0}) Likes",house.Likes);
			this.Rank = rank;
		}
开发者ID:jeffbmiller,项目名称:ChristmasLightsFinder.IOS,代码行数:7,代码来源:HouseMapAnnotation.cs


示例14: ViewDidLoad

		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();
			
			this.Title = "Pyramids of Giza";
			
			// create our location and zoom for the pyramids.
			CLLocationCoordinate2D coords = new CLLocationCoordinate2D(29.976111, 31.132778);
			MKCoordinateSpan span = new MKCoordinateSpan(MilesToLatitudeDegrees(.75), MilesToLongitudeDegrees(.75, coords.Latitude));

			// set the coords and zoom on the map
			this.mapMain.Region = new MKCoordinateRegion(coords, span);
			
			// show the sat view.
			this.mapMain.MapType = MKMapType.Satellite;
			
			// add an overlay with the coords
			this._circleOverlay = MKCircle.Circle(coords, 200);
			this.mapMain.AddOverlay(this._circleOverlay);
						
			// set our delegate.
			//this.mapMain.Delegate = new MapDelegate();
			
			//-- OR --
			//- override the GetVIewForOverlay directly, in which case we don't need a delegate
			this.mapMain.GetViewForOverlay += (m, o) => {
				if(this._circleView == null)
				{
					this._circleView = new MKCircleView(this._circleOverlay);
					this._circleView.FillColor = UIColor.Blue;
					this._circleView.Alpha = 0.5f;
				}
				return this._circleView;
			};
		}
开发者ID:ARMoir,项目名称:mobile-samples,代码行数:35,代码来源:MapWithOverlayScreen.xib.cs


示例15: ViewDidLoad

        public override void ViewDidLoad()
        {
            base.ViewDidLoad ();

            Title = "Mi Ubicacion";

            mapView = new MKMapView(View.Bounds);
            mapView.AutoresizingMask = UIViewAutoresizing.FlexibleDimensions;
            //mapView.MapType = MKMapType.Standard;	// this is the default
            //mapView.MapType = MKMapType.Satellite;
            mapView.MapType = MKMapType.Hybrid;
            mapView.ZoomEnabled = true;
            View.AddSubview(mapView);

            // this is all that's required to show the blue dot indicating user-location
            mapView.ShowsUserLocation = true;

            Console.WriteLine ("initial loc:"+mapView.UserLocation.Coordinate.Latitude + "," + mapView.UserLocation.Coordinate.Longitude);

            mapView.DidUpdateUserLocation += (sender, e) => {
                if (mapView.UserLocation != null) {
                    Console.WriteLine ("userloc:"+mapView.UserLocation.Coordinate.Latitude + "," + mapView.UserLocation.Coordinate.Longitude);
                    CLLocationCoordinate2D coords = mapView.UserLocation.Coordinate;
                    MKCoordinateSpan span = new MKCoordinateSpan(MilesToLatitudeDegrees(1), MilesToLongitudeDegrees(1, coords.Latitude));
                    mapView.Region = new MKCoordinateRegion(coords, span);
                }
            };

            if (!mapView.UserLocationVisible) {
                // user denied permission, or device doesn't have GPS/location ability
                Console.WriteLine ("userloc not visible, show cupertino");
                CLLocationCoordinate2D coords = new CLLocationCoordinate2D(37.33233141,-122.0312186); // cupertino
                MKCoordinateSpan span = new MKCoordinateSpan(MilesToLatitudeDegrees(20), MilesToLongitudeDegrees(20, coords.Latitude));
                mapView.Region = new MKCoordinateRegion(coords, span);
            }

            int typesWidth=260, typesHeight=30, distanceFromBottom=60;
            mapTypes = new UISegmentedControl(new RectangleF((View.Bounds.Width-typesWidth)/2, View.Bounds.Height-distanceFromBottom, typesWidth, typesHeight));
            mapTypes.InsertSegment("Mapa", 0, false);
            mapTypes.InsertSegment("Satelite", 1, false);
            mapTypes.InsertSegment("Hibrido", 2, false);
            mapTypes.SelectedSegment = 0; // Road is the default
            mapTypes.AutoresizingMask = UIViewAutoresizing.FlexibleTopMargin;
            mapTypes.ValueChanged += (s, e) => {
                switch(mapTypes.SelectedSegment) {
                case 0:
                    mapView.MapType = MKMapType.Standard;
                    break;
                case 1:
                    mapView.MapType = MKMapType.Satellite;
                    break;
                case 2:
                    mapView.MapType = MKMapType.Hybrid;
                    break;
                }
            };

            View.AddSubview(mapTypes);
        }
开发者ID:saedaes,项目名称:gestion2013,代码行数:59,代码来源:MapViewController.cs


示例16: PaylevenManager

        private const string ApiKey = ""; // TODO: Add your Api key

        #endregion Fields

        #region Constructors

        public PaylevenManager(Action<PLVPaylevenStatus> action, string currency, double latitude, double longitude)
        {
            Payleven = new PLVPayleven();

            StatusAction = action;
            Currency = new NSString(currency);
            LocationCoordinate = new CLLocationCoordinate2D (latitude, longitude);
        }
开发者ID:Applandeo,项目名称:PaylevenSample,代码行数:14,代码来源:PaylevenManager.cs


示例17: PointAnnotation

 public PointAnnotation(CLLocationCoordinate2D c)
     : base()
 {
     _title="";
     _subtitle="";
     Coordinate = c;
     Debug.WriteLine("Newly created pin at {0},{1}", c.Latitude, c.Longitude);
 }
开发者ID:fluffyclaret,项目名称:MapStuff,代码行数:8,代码来源:PointAnnotation.cs


示例18: latLngToTimezoneString

		public static string latLngToTimezoneString(CLLocationCoordinate2D location)
		{
			if (poly.Length == 0)
				TimezoneMapper.initPolyArray ();

			string tzId = timezoneStrings [getTzInt (lat: (float)location.Latitude, lng: (float)location.Longitude)];
			return tzId;
		}
开发者ID:tandygong,项目名称:LatLongToTimezone,代码行数:8,代码来源:Toolbox.TimeAndDate.TimezoneMapper.cs


示例19: SetLocation

		public void SetLocation(Point location){
			UIView.Animate(1.0, () =>
				{
					WillChangeValue("coordinate");
					_coordinate = new CLLocationCoordinate2D(location.Latitude, location.Longitude);
					DidChangeValue("coordinate");
				});
		}
开发者ID:kvandake,项目名称:TytySample,代码行数:8,代码来源:MapAnnotation.cs


示例20: BNRMapPoint

 public BNRMapPoint(string title, CLLocationCoordinate2D coord)
 {
     _title = title;
     this.coord = coord;
     NSDateFormatter dateFormatter = new NSDateFormatter();
     dateFormatter.DateStyle = NSDateFormatterStyle.Medium;
     dateFormatter.TimeStyle = NSDateFormatterStyle.Short;
     _subtitle = "Created: " + dateFormatter.StringFor(NSDate.Now);
 }
开发者ID:yingfangdu,项目名称:BNR,代码行数:9,代码来源:BNRMapPoint.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# CLLocationManager类代码示例发布时间:2022-05-24
下一篇:
C# CLLocation类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap