When working with Accounts in Creatio, the account address screen features the address fields and the ability to plot a map of the current location. In some situations, it might be necessary to change the default map icon that comes standard with the product. For example, a bank may want their address displayed with a special money vault icon to better represent their business on the map. In this situation, the default icon must be overridden on the map functionality to display a custom icon of our choice. Here’s how to change the default icon in a Creatio map.

Changing the Default Map Icon in Creatio

To make changes to Creatio’s mapping configuration, the maps module must first be updated. To do this, we need to look at the code behind it, which is in the OsmMapsModule schema.

Creatio osmmapsmodule

This module contains the functionality that receives data from the UI, formats it into the correct structure, and supplies it to the open street maps functionality to generate the map. To change its behavior, we should be extending it and adding the functionality we need via a custom module. We start this process by creating a new module named UsrOsmMapsModule.

Creatio creating a new module

Once the module is created, note that the “Messages” from the parent module don’t get inherited, so they will need to be recreated on the custom module exactly as they are in the parent module.

Creatio custom module

Next, look at the contents of OsmMapsModule and decide what needs to be overridden. For our purposes, we will override the getMarkerIcon method code and indicate within it that our custom icon should be used. This icon is named CustomMoneyIcon.

var iconUrl = Terrasoft.ImageUrlBuilder.getUrl(config.markerIcon || moduleresources.localizableImages.CustomMoneyIcon);

Notice the code line that references “moduleresources”. This refers to the resources (and images) of our new module. “resources” on the other hand refers to that resources of the base/parent module that represents the base functionality. Below is how the full code would look:

Creatio code lines

Finally, make sure to upload the custom icon named “CustomMoneyIcon” so that the code can find this icon when the map is being generated.

Creatio custom money icon name

If everything is done correctly, the new icon should take effect and should show up as it does in the screenshot below.

custom money icon image
Posted in:

Looking for Creatio help?

We do training, customization, integration, and much more. Contact us today.