core-location

Getting user's current location iOS 8.0

我只是一个虾纸丫 提交于 2019-12-02 15:17:56
问题 I trying to get users current location using MapKit and CoreLocation. I'm really new to Objective-C. As for my research the implementation is slightly different from older iOS to iOS 8.0. I have followed everything correctly. Still it is getting current location. My actual target is to get pin user location on the mapKit during run time when the user gives the location in the text field. filename.h #import <UIKit/UIKit.h> #import <MapKit/MapKit.h> @interface LocationSelectionViewController :

iOS CoreLocation: Is it possible to know if the location data is coming from GPS or from Wifi?

风流意气都作罢 提交于 2019-12-02 10:12:17
问题 I was wondering if we can get the source type of the current location in iOS. I didn't find any reference nor in CLLocationManager neither in CLLocation . I've found the same question here in SO, but for Android: Is it possible to know my location came from gps or glonass? Android. How to know if location detected is from GPS or Network provider The second one has an answer that says if the accuracy is smaller than 30 meters, than it is using GPS. But I don't know if we really can assume that

Calculating Cumulative elevation gain give me wierd results

二次信任 提交于 2019-12-02 09:52:43
I have the app that use CoreLocation and track user movement. When user is walking or driving I save each coordinate to local database (lat/lng/alt) so I can draw route based on saved coordinates. A few days ago I have added Cumulative elevation gain and I use this code in didLocationUpdate: - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation { netElevationGain += MAX(0, oldLocation.altitude - newLocation.altitude); } But something is just wrong. I started the application and start walking and walking around

Does the internal GPS antenas stop working immediately after calling CLLocationManager stopUpdatingLocation

半世苍凉 提交于 2019-12-02 09:45:19
Here is my scenario. In my app there is no need of continuously monitoring user location, but I need the location to be as accurate as possible. So I just call CLLocationManager startUpdatingLocation with kCLLocationAccuracyBestForNavigation set as desiredAccuracy, and after I get the location with my desired accuracy (by comparing newLocation.horizontalAccuracy with predefined value) I want to stop the location update and revoke update again after several seconds. But when I call stopUpdatingLocation the location icon from status bar disappears after about 10 seconds, does this mean that

how to find nearest latitude and longitude form current place?

给你一囗甜甜゛ 提交于 2019-12-02 09:33:26
I have a dictionary with a collection of n number of latitude, longitude and address. I want to calculate which (latitude and langitude)point is closest from current user location(latitude ,langitude) in ios? Thanks in advance Kumar KL If you want to calculate based on the co-ordinates , here is simple scenario : Just take all of the "CLLocationCoordinate2D" from your dictionary . For ex: MKPointAnnotation *annotaion=[MKPointAnnotaion alloc]alloc]; CLLocationCoordinate2D pointACoordinate = [annotation coordinate]; // If you have the co-ordinates in hand , then just make " CLLocation *loc2; "

Make MKMapView only zoom in on the centerCoordinate?

烈酒焚心 提交于 2019-12-02 09:00:06
I have a MKPinAnnotationView that is always in the center of the map. When panning and zooming the pin gives me the center coordinates (lat/long) of the map. Currently when you zoom in, it just zooms into wherever your directing the map to zoom into. I'd really like to lock the zoom onto the pin. Any ideas on how I'd achieve this? Assuming by MKPinAnnotation you mean MKPinAnnotationView, you can access the annotation's coordinate and use that to create a region and subsequently set the region of the mapView to that region centered on the coordinate: MKCoordinateRegion region =

Why MKCoordinateSpan changes?

心不动则不痛 提交于 2019-12-02 08:32:06
When I debug code below, I see that span is changed by mapkit from what I have provided. span2 contains different numbers from what was provided. Why is this happening? - (void) viewDidLoad { [super viewDidLoad]; CLLocationCoordinate2D loc; loc.latitude = self.atm.lat; loc.longitude = self.atm.lon; MKCoordinateSpan span1 = MKCoordinateSpanMake(0.05f, 0.05f); self.mapView.region = MKCoordinateRegionMake(loc, span1); // at this point numbers are not 0.05 anymore MKCoordinateSpan span2 = self.mapView.region.span; // ... more code } Note that latitude and longitude change differently so square

Error in main thread: MKNormalizedPointForLayer

♀尐吖头ヾ 提交于 2019-12-02 08:16:40
I am developing Core-Location based iPhone application and there is some strange error. When I send app in the background state and send it back to foreground, in main thread is error named MKNormalizedPointForLayer and nothing more. Where I have to go to find solution? Google is poor about it. 来源: https://stackoverflow.com/questions/9766272/error-in-main-thread-mknormalizedpointforlayer

iOS revoke location services permission programmatically

天涯浪子 提交于 2019-12-02 07:56:19
Is there a function on CLLocationManager or UIApplication to revoke location permission that is similar to the function unregisterForRemoteNotifications to revoke the push notification permission? The stopUpdatingLocation function on CLLocation does not revoke the permission. Once a user has granted (or denied) location permissions by responding to the original permission request dialog, the only way that the permissions can be changed is by the user themselves using the device settings app. You can just not use location services even though your app still has permission to do so. 来源: https:/

CoreLocation heading Android

眉间皱痕 提交于 2019-12-02 07:49:30
问题 I am currently working on an algorithm which requires an accurate estimate of the heading of the mobile device. For the development in iOS, I do not have to estimate the user heading as the framework already provides the value of trueHeading via CoreLocation framework. So I do not have to implement my own fusion algorithm. The beauty of this trueHeading is that it is very accurate and very stable, specially when the device is resting. This enables me to troubleshoot my algorithm. Now, I am