Location data

One of the unique features of mobile applications is location awareness.Mobile users bring their devices with them everywhere, and adding locationawareness 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 ofthe device — pinpointed using a combination of technologies — the direction andmethod of movement, and whether the device has moved across a predefinedgeographical boundary, or geofence.

ThemyLocationEnabledclass of theGMSMapView class controls whether the My Location dot is enabled.If enabled, themyLocationmethod of theGMSMapView class reveals where the device location dot is beingdrawn.

Location permissions

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

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 ofaccuracyAuthorization inCLLocationManager so your app behaves appropriately.See this video for more information.

Code samples

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

Themaps-sdk-for-ios-samplesrepository on GitHub also includes samples that demonstrate the use of locationdata.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-11-21 UTC.