Mobile devices, by their very nature, are used on the move and applications often need to capture the location of the user in order to provide the best user experience; for example, showing proximity to a business or services, or allowing users to check-in at a destination.
In this recipe, we will create a mobile Visualforce page to capture a lead and the location of the user at the point of lead creation. The location will be stored on the lead record in the Salesforce database in a custom geolocation field.
This recipe requires that you have already uploaded the Salesforce Lightning Design System version 2.0.2 as detailed in Chapter 8, Force.com Sites.
This recipe also requires a custom field on the lead sObject
to capture the location.
Navigate to the lead fields setup page by clicking on Your Name | Setup | App Setup | Customize | Lead | Fields.
Scroll down to the Lead Custom Fields and Relationships section and click on the New button.
On the next...