# <Map />
The screen component containing the react-native-maps Map and all related functionality.
Members
# inner constant followUserState
Flag that determines whether the map should focus and follow the user's location.
# inner constant lmAddVisibleState
Holds the visibility state of the AddLandmark modal.
# inner constant lmDetailsEditingState
Flag that toggles whether or not editing is enabled in the LandmarkDetails modal. The parent Map component has access to it so that it can disable closing the modal on backdrop press when it is enabled.
# inner constant lmDetailsVisibleState
Holds the visibility state of the LandmarkDetails modal.
# inner constant newLandmarkState
State that contains the new Landmark object which is passed down to the AddLandmark modal.
# inner constant selectedLandmarkState
State that contains the selected Landmark object which is passed down to the LandmarkDetails modal.
# inner constant userLocationState
State that holds a UserLocation object retrieved from location services.
Methods
# static openAddLandmark()
Opens the AddLandmark modal when the user creates newLandmarkState by longpressing the map.
Embedded in a useEffect hook that listens to newLandmarkState
.
# async static requestLocationPermissions()
Prompts user to give permission to track their location using expo-location.
If permission is granted, user location will be retrieved and stored in userLocationState
.
# inner flyToUser()
Animates the map to fly over to and focus on the user's location.
# inner focusLandmark()
Triggered by on a Landmark displayed on the map.
Sets selectedLandmark
to the pressed Landmark object's value and toggles the LandmarkDetails modal.
# inner promptAddLandmark()
Triggered by long pressing on the map.
Sets newLandmarkState
to a skeleton Landmark object that only contains the pressed coordinates.
Triggers openAddLandmark via useEffect because the asyncronous nature of useState does not set the coordinates fast enough to toggle the modal directly through this method.