コード例 #1
0
		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();

			locationManager = new CLLocationManager ();
			locationManager.AuthorizationChanged += OnAuthorizationChanged;
			locationManager.LocationsUpdated += OnLocationsUpdated;
			locationManager.DesiredAccuracy = CLLocation.AccuracyBest;
			locationManager.ActivityType = CLActivityType.Other;

			// We setup a pair of anchors that will define how the floorplan image, maps to geographic co-ordinates
			var anchor1 = new GeoAnchor {
				LatitudeLongitude = new CLLocationCoordinate2D (37.770511, -122.465810),
				Pixel = new CGPoint (12, 18)
			};

			var anchor2 = new GeoAnchor {
				LatitudeLongitude = new CLLocationCoordinate2D (37.769125, -122.466356),
				Pixel = new CGPoint (481, 815)
			};

			anchorPair = new Tuple<GeoAnchor, GeoAnchor> (anchor1, anchor2);

			// Initialize the coordinate system converter with two anchor points.
			coordinateConverter = new CoordinateConverter (anchorPair);
		}
コード例 #2
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            locationManager = new CLLocationManager();
            locationManager.AuthorizationChanged += OnAuthorizationChanged;
            locationManager.LocationsUpdated     += OnLocationsUpdated;
            locationManager.DesiredAccuracy       = CLLocation.AccuracyBest;
            locationManager.ActivityType          = CLActivityType.Other;

            // We setup a pair of anchors that will define how the floorplan image, maps to geographic co-ordinates
            var anchor1 = new GeoAnchor {
                LatitudeLongitude = new CLLocationCoordinate2D(37.770511, -122.465810),
                Pixel             = new CGPoint(12, 18)
            };

            var anchor2 = new GeoAnchor {
                LatitudeLongitude = new CLLocationCoordinate2D(37.769125, -122.466356),
                Pixel             = new CGPoint(481, 815)
            };

            anchorPair = new Tuple <GeoAnchor, GeoAnchor> (anchor1, anchor2);

            // Initialize the coordinate system converter with two anchor points.
            coordinateConverter = new CoordinateConverter(anchorPair);
        }