userlocation

How do I determine if the current user location is inside of my MKCoordinateRegion?

陌路散爱 提交于 2019-12-05 23:22:26
问题 I have a coordinate region that I have determined contains the limits of what I want to show for my app. I have set this up as an MKCoordinateRegion with center point lat, longitude and a span. How do I determine if the current userLocation is inside of my coordinate region? 回答1: Use map rects. Here's an example using the map's current visible rect. With regards to your question, you could use convertRegion:toRectToView: to first convert your region to a MKMapRect beforehand. MKMapPoint

NSLocationWhenInUseUsageDescription warning but i have already added it

痞子三分冷 提交于 2019-12-05 11:30:37
问题 While i have already added NSLocationWhenInUseUsageDescription I keep receiving this warning This app has attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSLocationWhenInUseUsageDescription key with a string value explaining to the user how the app uses this data FYI: I have multiple info.Plist in the app. Not sure what to do? 回答1: Adding both NSLocationAlwaysAndWhenInUseUsageDescription and NSLocationWhenInUseUsageDescription keys

[iOS]capturing user location: clarification

£可爱£侵袭症+ 提交于 2019-12-05 02:38:05
问题 I've an app that capture user location and send this info to my server. I've started the LocationManager service with: - (CLLocationManager *)locationManager { if (_locationManager == nil) { _locationManager = [[CLLocationManager alloc] init]; _locationManager.delegate = self; isUpdatingLocation = NO; } return _locationManager; } -(void) startLookingForLocation{ [self locationManager].desiredAccuracy = kCLLocationAccuracyBest; [self locationManager].distanceFilter = 250; if([[self

Where do the location and currentBestLocation come from? in Android Dev Guide (Obtaining User Location)

自闭症网瘾萝莉.ら 提交于 2019-12-04 13:15:47
问题 I read the tutorial about Obtaining User Location in Android Dev Guid and, I try to adapt this to the following code.. but i don't know which location value I should put into isBetterLocation(Location location, Location currentBestLocation) Example.class private LocationManager locman; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); String context = Context.LOCATION_SERVICE; locman = (LocationManager

Check if user location is visible on map iphone

拥有回忆 提交于 2019-12-04 05:37:04
I want to hide or show a UIButton weather user's current location is visible on map. While testing the code xcode I can see meassage "User location view is NOT visible but should be. Showing...." on console in "didUpdateLocation" method if users location is not visible on map. How can I use this message to generate events in my case to hide or show a UIButton? Thanks for any help in advance. If you want to know whether the user location is contained in the currently displayed map region, you can check the userLocationVisible property in the regionDidChangeAnimated delegate method: - (void

NSLocationWhenInUseUsageDescription warning but i have already added it

喜夏-厌秋 提交于 2019-12-04 00:48:54
While i have already added NSLocationWhenInUseUsageDescription I keep receiving this warning This app has attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSLocationWhenInUseUsageDescription key with a string value explaining to the user how the app uses this data FYI: I have multiple info.Plist in the app. Not sure what to do? Adding both NSLocationAlwaysAndWhenInUseUsageDescription and NSLocationWhenInUseUsageDescription keys in plist solved my problem. <key>NSLocationAlwaysUsageDescription</key> <string>Your location is required

Check if user location is inside a shape

可紊 提交于 2019-12-03 21:31:14
I made this method to check if an user location is inside a polygon on a map view (mapkit). I pass to the method the current user location (CLLocationCoordinate2D) and return a boolean just to know if the user is in a polygon or not. func userInsidePolygon(userlocation: CLLocationCoordinate2D ) -> Bool{ // get every overlay on the map let o = self.mapView.overlays // loop every overlay on map for overlay in o { // handle only polygon if overlay is MKPolygon{ let polygon:MKPolygon = overlay as! MKPolygon let polygonPath:CGMutablePathRef = CGPathCreateMutable() // get points of polygon let

Where do the location and currentBestLocation come from? in Android Dev Guide (Obtaining User Location)

家住魔仙堡 提交于 2019-12-03 08:27:12
I read the tutorial about Obtaining User Location in Android Dev Guid and, I try to adapt this to the following code.. but i don't know which location value I should put into isBetterLocation(Location location, Location currentBestLocation) Example.class private LocationManager locman; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); String context = Context.LOCATION_SERVICE; locman = (LocationManager)getSystemService(context); Criteria criteria = new Criteria(); criteria.setAccuracy(Criteria.ACCURACY_FINE);

How to Increase the Radius of userLocation Annotation in Mapkit

拟墨画扇 提交于 2019-12-01 10:26:16
问题 My app takes user permission and move the map to the location. And at that position by default MapKit add a blue icon which is generating some pulse. I've searched around but I found how to add a 1000m circle around userLocation . I don't want that. You can say I'm looking to customize the userLocation default annotation . The blue pulse it generates I want to increase that radius . And when this blue pulse hits a custom annotation there should be a method triggered. So how to achieve that?

Sort array by distance near user location from firebase

自古美人都是妖i 提交于 2019-11-29 08:59:16
Can't figure out how to do automatic sorting addresses near the user. I can not understand where to start and how to write code. I have addresses in my firebase . Addresses have type string (not latitude / longitude). Example: "Москва, Электрозаводская, 21" "Москва, Арбат, Староконюшенный переулок, дом 43" "Москва, улица 1-я Бухвостова, дом 12/11, корпус 53" I know what need use query from firebase, but how use query , i don't understand now. It's my code: class PhotoStudiosViewController: UIViewController, UITableViewDelegate, UITableViewDataSource, UIScrollViewDelegate { @IBOutlet weak var