One of the unique features of mobile applications is location awareness.
Mobile users bring their devices with them everywhere, and adding location
awareness to your app offers users a more contextual experience.

## Work with location data

The location data available to an iOS device includes the current location of
the device --- pinpointed using a combination of technologies --- the direction and
method of movement, and whether the device has moved across a predefined
geographical boundary, or geofence.

The
[`myLocationEnabled`](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMapView.md.txt#mylocationenabled)
class of the `GMSMapView` class controls whether the My Location dot is enabled.
If enabled, the
[`myLocation`](https://developers.google.com/maps/documentation/ios-sdk/reference/objc/Classes/GMSMapView.md.txt#mylocation)
method of the `GMSMapView` class reveals where the device location dot is being
drawn.

## Location permissions

Your app must prompt the user for consent to use location services. To do this,
include the `NSLocationAlwaysUsageDescription` key in the `Info.plist` file for
the app, and set the value of each key to a string that describes how the app
intends to use location data.

> [!NOTE]
> **Note:** iOS 14 introduced a new privacy feature where users can choose to share their approximate, rather than precise, location. Check your app's value of `accuracyAuthorization` in `CLLocationManager` so your app behaves appropriately. [See this video for more information.](https://developer.apple.com/videos/play/wwdc2020/10162/)

## Code samples

The following tutorial and code sample demonstrate the use of location on a map:

- [Select current place tutorial](https://developers.google.com/maps/documentation/ios-sdk/current-place-tutorial.md.txt)
- [Enable the My Location button](https://developers.google.com/maps/documentation/ios-sdk/examples/enable-my-location.md.txt)

The
[maps-sdk-for-ios-samples](https://github.com/googlemaps-samples/maps-sdk-for-ios-samples)
repository on GitHub also includes samples that demonstrate the use of location
data.