Configuration¶
You need to configure this add-on in the following ways:
- Runtime config in Lime Admin
- Application config
- If the licensed version is to be activated: Follow internal Lime Technologies documentation for how to do this.
Lime Admin Configuration¶
There are two ways to add a map in the Lime CRM web client UI:
- As a map on a card.
- As an optional view in the Global Explorer.
They are configured individually per limetype. But both require that the involved limetype first is added in the Maps configuration in Lime Admin under Settings
.
Maps Configuration¶
This refers to the configuration you can do under Settings->Maps->Limetypes.
Coordinates¶
Select the fields in which to store the fetched longitude and latitude coordinates as well as the field to store the last used query sent to Google. These three fields are typically created for you during the installation.
Info
The field Last used coordinate query
will help the add-on know whether you actually need to fetch the coordinates again, after an address has been changed.
Info
If you modify the Maps configuration to utilize the pre-filled coordinate fields instead of the Maps coordinate fields, please ensure that the "Coordinate fields" are left empty. Failure to do so may result in the removal of any previously added coordinates.
Location Fields¶
Choose which fields should be sent to Google to search for the location. Keep in mind that having too many fields may result in a loss of accuracy. Choose fields that will generally be filled with values by the CRM users.
Info
Names should not be used for privacy persons reasons and for accuracy of the search.
An example for company is shown in the image below.
Information Fields¶
Choose which fields should be shown as the header and subheader on the Global Explorer map view. An example for company is shown in the image below.
Map on Card¶
Add the web component lwc-limepkg-maps-map-on-card
on any field you like, to completely replace that field with a map view instead. The field map_query
created during the installation is typically used.
Map View in Global Explorer¶
On the limetype where you want to use the map view, add the custom view lwc-limepkg-maps-map-view
. Set the localization key limepkg_maps.map-view.open
as Title.
If you want to use the coordinates of a related object, e.g. the company's coordinates for an overview of todos, or the real estate property's coordinates for viewing work orders, add the property relatedType
with the name of the property you want to use. Remember that the both the limetype where you want to view the map and the limetype of the related property must be configured under Settings->Maps->Limetypes for this to work.
Warning
Never use address fields that have been copied for some reason into the limetype you are viewing. Instead, configure Maps to use the original address of the related limeobject. This will make the performance faster since the coordinates are likely already fetched for the related limeobject. For example, if the coordinates are fetched for the real estate property when the first work order was to be shown, no extra call to Google to fetch coordinates will have to be made for all subsequent work orders on that same real estate property.
In the related data, add both of the coordinate fields, the field that is used for storing the last used query, and all of the fields that are used to search for the correct location.
Warning
If you do not add ALL the fields here, the Maps add-on will try to re-load the coordinates for all objects every time the maps view is used. This will either make a very big hit on the performance, or it will make the Map view not load at all.
Application Config¶
The application config contains the API keys that are used to communicate with Google. There is a different API key which is used in frontend calls to the Google API and an API key which is used in the backend for calls to the Google API.
Cloud Example¶
In the secrets section, set the two API keys:
limepkg-maps:
api-key:
frontend: <Google API key provided for the frontend>
backend: <Google API key provided for the backend>
On-premise Example¶
Add the below configuration to the application_config.yaml
file.
<app-name>:
secrets:
limepkg-maps:
api-key:
frontend: <Google API key provided for the frontend>
backend: <Google API key provided for the backend>
Info
If there is no application_config.yaml
file yet, simply create it! But remember to set the correct <app_name>
at the top of the file.