Skip to content

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.

Lime Admin config - company location fields example

Views

For each limetype you can configure several views, each with their own look and information. If you want to use multiple views, the name of each view must be unique

Lime Admin config - view names example

Marker colors

It's possible to give markers on the map different colors based on a property on your limetype, or even based on a property on a related limetype. There are three different property types that can be used.

Option field

If you use an option field, you can add Color options for each option that exists on the field. Options that are not explicitly configured will keep the default (red) colored pins.

Lime Admin config - color configuration for option field

Yes/no field

The configuration for a yes/no field works exactly the same as for an option field, except that there will be only 2 options to choose from: Yes and No.

Text (color) field

In some cases, you will want to define a specific color in a text field, either on the object itself or on a related object. In that case, make sure that the component limel-color-picker is added on the field you are using for this color, to make it easier to actually add a color in the client. Objects that do not have a color defined in this field will be displayed in the default (red) color on the map.

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.

Lime Admin config - company description fields example

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.

Lime Admin config - Map on card

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.

Lime Admin config - Maps view

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.