Cirrious.MvvmCross.Plugins.Location.Touch.MvxTouchGeoLocationWatcher.PlatformSpecificStart C# (CSharp) Method

PlatformSpecificStart() protected method

protected PlatformSpecificStart ( MvxGeoLocationOptions options ) : void
options MvxGeoLocationOptions
return void
        protected override void PlatformSpecificStart(MvxGeoLocationOptions options)
        {
            lock (this)
            {
                if (_locationManager != null)
                    throw new MvxException("You cannot start the MvxLocation service more than once");

                _locationManager = new CLLocationManager();
                _locationManager.Delegate = new LocationDelegate(this);

				// more needed here for more filtering
				// _locationManager.DistanceFilter = options. CLLocationDistance.FilterNone

				_locationManager.DesiredAccuracy = options.EnableHighAccuracy ? CLLocation.AccuracyBest : CLLocation.AccuracyKilometer;
         		
				if (CLLocationManager.HeadingAvailable)
					_locationManager.StartUpdatingHeading();

				_locationManager.StartUpdatingLocation();
			}
        }