|
| 1 | +# Integrate geolocation |
| 2 | + |
| 3 | +This guide provides step-by-step instructions for integrating geolocation platforms such as MapTiler with the OpenSPP Farmer Registry module to enhance area-based functionality. |
| 4 | + |
| 5 | +## Prerequisites |
| 6 | +To enable geolocation integration in OpenSPP, ensure the following: |
| 7 | +- Your user account has the System Admin role. Learn more in this guide: {doc}`user_access`. |
| 8 | +- Your OpenSPP instance has the Farmer Registry base module installed. Learn more in this guide: {doc}`../../getting_started/farmer_installation`. |
| 9 | +- You have an API key for MapTiler to enable GIS functionality. You can retrieve this by checking their documentation [here](https://docs.maptiler.com/cloud/api/). |
| 10 | +- Developer mode in OpenSPP is enabled to allow configuration of the MapTiler key. For details, refer to the {doc}`../../developer_guide/developer_mode`. |
| 11 | + |
| 12 | +## Objective |
| 13 | +By the end of this guide, you will have configured MapTiler integration to enable area-based features in the Farmer Registry and will learn how to add, edit, and remove farm geolocation data using the map tools. |
| 14 | + |
| 15 | +## Process |
| 16 | + |
| 17 | +### Setting Up the API Key for MapTiler |
| 18 | +As a System Admin, log in to your OpenSPP Farmer Registry instance. Go to **Settings**, then select **Technical**, and click **System Parameters**. |
| 19 | + |
| 20 | + |
| 21 | + |
| 22 | +Click the **New** button. Set the Key field to **spp_base_gis.map_tiler_api_key** and enter your MapTiler API key in the **value** field. |
| 23 | + |
| 24 | + |
| 25 | + |
| 26 | +```{note} |
| 27 | +Keep your API key secure. Avoid sharing it publicly or storing it in version control systems. |
| 28 | +``` |
| 29 | + |
| 30 | +Click the **Save** button to apply the configuration. Refresh your browser to see the changes. |
| 31 | + |
| 32 | +### Add Geolocation Data |
| 33 | + |
| 34 | +After setting up the API key for the geolocation platform, navigate to the Registry and click an existing farm group, then open the **Farm Details** tab. |
| 35 | + |
| 36 | + |
| 37 | + |
| 38 | +#### Add Address Coordinates |
| 39 | + |
| 40 | +Under the **Farm Details** tab, click **Address Coordinates**. |
| 41 | + |
| 42 | +Click the Marker tool once, then select a location on the map to add a pin for the farm. |
| 43 | + |
| 44 | + |
| 45 | + |
| 46 | +You can also click the **Find My Location** button to center the map on your current location. |
| 47 | + |
| 48 | + |
| 49 | + |
| 50 | +#### Add Farm Land |
| 51 | + |
| 52 | +Under the **Farm Details** tab, click **Farm Land**. |
| 53 | + |
| 54 | +Click the polygon tool once, then click the map to add vertices until the area is outlined; double-click the final point to close the polygon. |
| 55 | + |
| 56 | + |
| 57 | + |
| 58 | +You can also click the **Find My Location** button to center the map on your current location. |
| 59 | + |
| 60 | + |
| 61 | + |
| 62 | +### Remove Geolocation Data |
| 63 | + |
| 64 | +To remove geolocation data, navigate to the **Farm Details** tab, then open the tab for either **Address Coordinates** or **Farm Land**. |
| 65 | + |
| 66 | +Click the trash icon to remove the geolocation data. |
| 67 | + |
| 68 | + |
| 69 | + |
| 70 | +```{note} |
| 71 | +- The trash icon appears only when there is existing map data. |
| 72 | +- Deletion cannot be undone. |
| 73 | +``` |
0 commit comments