---
title: "setUserTrackingMode(_:animated:)"
framework: watchkit
role: symbol
role_heading: Instance Method
path: "watchkit/wkinterfacemap/setusertrackingmode(_:animated:)"
---

# setUserTrackingMode(_:animated:)

Sets the map’s tracking mode.

## Declaration

```swift
func setUserTrackingMode(_ mode: WKInterfaceMap.UserTrackingMode, animated: Bool)
```

## Parameters

- `mode`: The desired tracking mode. For a complete list of valid tracking modes, see doc://com.apple.watchkit/documentation/WatchKit/WKInterfaceMap/UserTrackingMode.
- `animated`: A Boolean value that indicates whether the map animates the change to the tracking mode.

## Discussion

Discussion By default, the tracking mode is WKInterfaceMap.UserTrackingMode.none. Setting the tracking mode to WKInterfaceMap.UserTrackingMode.follow causes the map to center on the user’s location and begin tracking the user. If the map is zoomed out, the map view automatically zooms in on the user’s location, effectively changing the current visible region.

## See Also

### Displaying the User’s Location

- [setShowsUserLocation(_:)](watchkit/wkinterfacemap/setshowsuserlocation(_:).md)
- [setShowsUserHeading(_:)](watchkit/wkinterfacemap/setshowsuserheading(_:).md)
- [WKInterfaceMap.UserTrackingMode](watchkit/wkinterfacemap/usertrackingmode.md)
