Getting the User's Location
You can access the user's location so they can save their travels or compare distances with other addresses.
Skill Level: Intermediate
1.) Before you can start access a user's location, the app must first ask for their permission to do so. You can have the app request permission manually by adding a Click Action to any component, hovering Location, then clicking Request Permission. It's usually best to have this action either on screen load or when the user first tries to access location or map features of your app.
You can access the user's location through Magic Text in two different ways:
1.) Selecting the Current Device Location as with the Location Input component, form components, and other areas where you need to fill in a Location property specifically.
Selecting the Current Device Location as the default location for a Location Input Component
Selecting the Current Device Location as part of a Create Action to set the Location property (Destination) of a new Trip.
2.) Selecting the Current Device Location's > individual data properties such as full address, zip code, latitude, longitude, etc. by hovering over the Current Device Location > itself and choosing the piece of data you need. This is for filling in fields that are not location property types.
Setting a map's marker address to the Current Device Location's Full Address
- A user's location is not continuously updated. User device location is only pulled when they take an action in the app that uses their location (create, update, etc.). Thus, the user is not able to be tracked the way you might track your Uber driver or Doordash delivery.
- Getting device location works on Android, iOS, PWAs, and desktop web apps.