myLocationEnabled property

bool myLocationEnabled
final

True if a "My Location" layer should be shown on the map.

This layer includes a location indicator at the current device location, as well as a My Location button.

  • The indicator is a small blue dot if the device is stationary, or a chevron if the device is moving.
  • The My Location button animates to focus on the user's current location if the user's location is currently known.

Enabling this feature requires adding location permissions to both native platforms of your app.

  • On iOS add a NSLocationWhenInUseUsageDescription key to your Info.plist file. This will automatically prompt the user for permissions when the map tries to turn on the My Location layer.

Implementation

final bool myLocationEnabled;