Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

ios 8 showuserlocation problem..

$
0
0

i used these ways,

updated infoplist like additional file

also used these codes

  CLLocationManager locationManager;

      public override void ViewDidLoad()
      {
         base.ViewDidLoad();
         // Perform any additional setup after loading the view, typically from a nib.
         locationManager = new CLLocationManager();
         locationManager.DesiredAccuracy = CLLocation.AccuracyBest;
         locationManager.ActivityType = CLActivityType.Other;


         if (locationManager.RespondsToSelector(new MonoTouch.ObjCRuntime.Selector("requestWhenInUseAuthorization")))
         {
            locationManager.RequestWhenInUseAuthorization();
         } 


         myMap.ShowsUserLocation = true;

         myMap.DidUpdateUserLocation += (sender, e) =>
         {
            if (myMap.UserLocation != null)
            {
               CLLocationCoordinate2D location;
               location.Latitude = myMap.UserLocation.Coordinate.Latitude;
               location.Longitude = myMap.UserLocation.Coordinate.Longitude;
               myMap.CenterCoordinate = location;
               myMap.ShowsUserLocation = true;

            }
         };

         myMap.ShowsUserLocation = true;

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


         myMap.ShowsUserLocation = true;

         myMap.DidUpdateUserLocation += (sender, e) =>
         {
            if (myMap.UserLocation != null)
            {
               CLLocationCoordinate2D location;
               location.Latitude = myMap.UserLocation.Coordinate.Latitude;
               location.Longitude = myMap.UserLocation.Coordinate.Longitude;
               myMap.CenterCoordinate = location;
               myMap.ShowsUserLocation = true;

            }
         };

but i cant show location,

problem may on ide or sdk?


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>