The Axsy Mobile App's Flow Engine supports a custom Axsy component for Geo-Location Capture, allowing users to capture latitude and longitude coordinates as part of a Flow within the mobile app.
Adding the Geo-Location Capture Component to a Flow
Included in Axsy's Managed Package is a custom Geo Location Flow component. It is accessible in the Salesforce Flow designer and, like other components, can be added via drag-and-drop when editing a Flow Screen.
The custom Axsy Geo Location component can be added to a Flow screen in the Flow designer
In addition to the standard API Name and Label parameters, the Geo Location component also includes the following parameters that can be defined:
Parameter | Description |
---|---|
Latitude & Logitude | These two parameters are the output parameters for the Geo Location Flow component. Whatever geo-location is eventually captured by the user will have its latitude and longitude stored in these parameters for further use in the Flow. Optionally, these two parameters can also be used as input parameters and, when set, will define the default initial location for the map UI. |
Lock to Current Location | True/False value for only allowing the user to capture their current geo-location rather than let them choose a geo-location by tapping the map UI. Defaults to false if left blank. If this is set to true, then the Latitude and Longitude parameters should be left blank since a default location is non-applicable when the only option is to lock to the user's location. |
Required | True/False value for setting if a value is required. Defaults to false if left blank. |
Latitude Delta & Longitude Delta | Sets the initial zoom for the map UI by defining the difference between the minimum and maximum latitude or longitude within the initial visible region of the map. These parameters are optional and it is recommended to only use these when the default zoom is inadequate for the desired behaviour. |
Tag Labels, Tag Latitudes & Tag Longitudes | These optional parameters are used together to add informative pins to the map UI. When used, each parameter should be a semi-colon-separated list with each element of the list representing the label, latitude and longitude of the informative pins to display, respectively. |
NOTE: The geo-location captured by the user will set the Latitude and Longitude parameters with String values. As such, the coordinates may need to be converted to numeric values by the Flow depending on how these values are to be used.
Capturing Geo-Location in the Mobile App
The Axsy Mobile App behaviour when running a Flow that includes the Geo Location Flow component will differ slightly depending on the how the component was configured in the Flow designer.
Latitude and Longitude Parameters Are Initially Blank
If the Latitude and Longitude parameters are initially blank - and therefore not being used as input parameters - the Geo Location Flow component in the Axsy Mobile App will be initially presented as a blank tappable area in the Flow labelled "Location". Tapping that blank area will then bring up the map UI, initially centered on the user's current location. The user can then either tap the map to select the tapped point's geo-location, or they can select the Current button to select their own current geo-location. Hitting Save will then capture the selected coordinates, store them in the Latitude and Longitude parameters of the Flow component and return back to the Flow UI with the captured location displayed.
Tapping the "Location" area will bring up the map UI so the user can select a location
Once in the map UI, tapping a point on the map will select that location, or the user can tap the "Current" button to select their own current location
Tapping the "Save" button will then capture the selected coordinates and display the captured location back within the Flow UI
Latitude and Longitude Parameters Are Initially Set
If the Latitude and Longitude parameters are set with initial input values then, as opposed to presenting a blank area in the Flow, the Axsy Mobile App will instead display that initial location as the default location for the map. Tapping on the map will still bring up the map UI where the user can select a new location - or their current location - and capture that new location with the Save button. Doing so will overwrite the initial Latitude and Longitude parameters with the newly captured coordinates and update the Flow UI accordingly.
If initial values for "Latitude" and "Longitude" are set, then the Flow UI will present this initial geo-location rather than a blank area.
Locked to Current Location
If the Lock to Current Location parameter is set to true, then the tappable area within the Flow will be labeled "Set My Location". Tapping the area will not bring up the map UI and will instead automatically capture the user's current coordinates and update the Flow UI accordingly.
NOTE: Given the Lock to Current Location parameter does not allow a user-selected geo-location, the Latitude and Longitude parameters should be left blank and not used as input parameters.
Additional Tag Labels and Locations Defined
The Tag Labels, Tag Latitudes and Tag Longitudes parameters give the ability to include informative pins and labels within the Flow's map UI. Each of these 3 parameters should be set with a semi-colon-separated list with the 1st element of each list combining to specify one pin and label, the 2nd element of each list combining to specify another pin and label, and so on.
For example, the below screenshot of the Flow designer will result in the two following informative pins with labels to be displayed in the map UI:
- "Broken Gate" with coordinates 43.667971860781634,-79.39884627454562
- "Cracked Sidewalk" with coordinates 43.66971800145674,-79.4008096514296
Example screenshot of how to configure informative labels and pins to display in the map UI
The screenshot below shows how the above informative pins and labels are then displayed in the map UI:
Example screenshot of informative labels and pins included in the map UI