Questions tagged [userlocation]

149 questions
55
votes
5 answers

NSLocationWhenInUseUsageDescription warning, but I have already added it

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…
Mohamed
  • 647
  • 1
  • 5
  • 9
40
votes
8 answers

How do I remove all annotations from MKMapView except the user location annotation?

I use removeAnnotations to remove my annotations from mapView but same it remove user location ann. How can I prevent this, or how to get user ann back to view? NSArray *annotationsOnMap = mapView.annotations; [mapView…
Pavel Kaljunen
  • 1,291
  • 2
  • 26
  • 53
34
votes
5 answers

How to change MKMapView's user-location blue dot to an image of choice?

Is it possible to change the blue dot which indicates the user's location in MKMapView to an image? For example a little car or any .png image?
Pangolin
  • 7,284
  • 8
  • 53
  • 67
9
votes
7 answers

MKMapView's user location is wrong on startup or resume

When I start my application fresh, or resume after a long time, MKMapView's notion of the userLocation is wrong and shows me in the middle of the sea. I am using the following code: self.mapView.centerCoordinate =…
DeShawn Terrell
  • 295
  • 2
  • 4
  • 7
9
votes
2 answers

How should I find the correct location data using userLocation in Mapbox for iOS SDK? (Swift)

I'm trying to find the latitude and longitude of the user's location so that I can center the map on the user in viewdidload. I've implemented what seems to be the right code but the values of userLat (latitude) and userLon (longitude) are way…
HJo
  • 1,902
  • 1
  • 19
  • 30
8
votes
3 answers

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

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…
Alan Moore
  • 6,525
  • 6
  • 55
  • 68
6
votes
5 answers

Getting 0.0 for latitude and longitude while showing current location in map

I am using the following code to get my current location. But the problem I am facing is, it always returns 0.0 for latitude and longitude. I have turned on the GPS settings in the phone and set all the permissions. But still I am facing…
tejas
  • 2,435
  • 10
  • 37
  • 54
6
votes
3 answers

Check if user location is visible on map iphone

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…
alekhine
  • 1,600
  • 4
  • 20
  • 45
6
votes
1 answer

How do you center the MKMapView map visually when a user location is known or changes?

I have read and followed the instructions on How do I zoom an MKMapView to the users current location without CLLocationManager? However, while I do get the current user location, I am unable to actually make the map visually center there. For…
DeShawn Terrell
  • 295
  • 2
  • 4
  • 7
6
votes
1 answer

How can I change text "App would like to use your current location?"

Can we change this text? I have used property purpose of CLLocationManager class. But message did not change. [locationManager setPurpose:@"Change text message"]; Any ideas? Thanks,
SangamAngre
  • 809
  • 8
  • 25
6
votes
1 answer

Disable MKmapkit mapView userLocation annotationView

I have a mapView with annotationViews and the userLocation blue dot. I am using the following code to get the blue dot: [self.mapView setShowsUserLocation:YES]; The annotationViews are selectable and have callouts. However if an annotationView is…
user1607483
  • 143
  • 5
5
votes
4 answers

MKUserLocation blue userLocation MKAnnotation causes app to crash if inadvertently touched

I have a MKMap with a series of MKAnnotations, all of which are red which is fine. I have selected "show user location" in IB and to change the MKAnnotation from red to blue, I have the code in my viewForAnnotation method: if (annotation ==…
timv
  • 3,346
  • 4
  • 34
  • 43
5
votes
1 answer

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

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…
April Smith
  • 1,810
  • 2
  • 28
  • 52
4
votes
3 answers

Get the address of current user location

I follow some tutorial and mix my awful code. Now I can get my current location. And when I tap on a button it will trigger a pin which locates on my current location. If I tap on the pin, the message shows address of my current. I have two…
hitheredude
  • 929
  • 5
  • 18
  • 32
4
votes
0 answers

MapboxGL React Native UserLocation Indicator do not display on map

The UserIndicator from , work and display fine on IOS, but with android, it's depends, it sometime work, sometime not, and i realize also, that my CameraRef.current.setCamera() is undefined when the UserIndicator doesn't…
1
2 3
9 10