Drop the geolocation folder into your /system/user/addons/ folder (or wherever you have your add-ons installed).
Navigate to your Extensions in the Control Panel and install it like any other add-on.
You'll need a Mapbox account with access to the Permanent Geocoding API (available by reaching out to Mapbox support).
Mapbox API Key
Enter your Mapbox account API key.
Country Restrictions
Setting a country restrictions will limit geocoding results to those countries selected. It is recommended to set this to limit results to those that are relevant.
Types
Setting the types returned will determine the level of "specificity" returned in geocoded results.
Enter map center
Set the center of your starting map in the control panel. By default this is set to the center of the US but you could/should update this to a realistic center point for your usage. Doing so will decrease the mapping API calls and data usage in the control panel.
From the control panel Publish tab use the map search and begin typing the address. Select the correct result from the live drop-down and the components will populate on the side. The components can be manually edited if you desire.
The following variables are available for the fieldtype.
lat
{field_name:lat}
Displays the latitude coordinate component.
lng
{field_name:lng}
Displays the longitude coordinate component.
formatted_address
{field_name}
{field_name:formatted_address}
Outputs the fully formatted address component.
address
{field_name:address}
Displays the address component.
place
{field_name:place}
Displays the place/city component.
district
{field_name:district}
Displays the district/county component.
region
{field_name:region}
Displays the region/state/province component.
state
{field_name:state}
This is the same as region but implemented for ease.
province
{field_name:province}
This is the same as region but implemented for ease.
postcode
{field_name:postcode}
Displays the postal code component.
country
{field_name:country}
Displays the country component.
Pro Search is supported using a custom search filter. The filter can be used to search individual components or as a distance filter. Individual component searching works much like the native search:field_name for grid fields. Distance searching has a format similar to the Pro Search distance filter.
search:field_name:component
<input type="text" name="search:field_name:postcode" value="" />
Any template variable can be used in the search.
geolocation:from
This input value should be the latitude and longitude to search from. Example: 32.8072989|-79.9962137
geolocation:to
This input value is the field name of your geolocation field that you are searching against.
geolocation:radius
This should be the search radius as a number
geolocation:unit
The distance units to use. Valid options are 'km', 'yd', 'm', 'mi'. Miles is used by default.