In some cases, you may want to use shared maps with URL parameters. For example, to embed a shared map into a customer portal, so that when a customer logs into your portal and the customer's id becomes known, you can show on the embedded map only records assigned to this particular customer while hiding all others. To achieve this, you may add customer_id URL parameters to the shared map's like while using this URL parameter in a Map layer's formula to filter records by the customer id:

  • Map layer's formula: Customer ID = {{url.customer_id}}

  • Shared map's link:

In this case you're effectively using a URL parameter to restrict visibility to certain records so it's essential that the customer cannot alter the customer_id in order to see records assigned to another customer.

To prevent such alteration, you should check the Request URL signature checkbox in the Shared map configuration and add the URL signature generated for this particular link including the customer_id value. In this case, before loading the shared map Mapsly will check validity of the URL signature and will load the map only if the signature matches the link with all its URL parameters for which it was generated.

How to generate URL signature

There are several ways to do it:

1- For a static link, which doesn't contain record-specific URL parameters like the customer_id, you may generate a signature right in the Shared map configuration popup.

2- For links with dynamic URL parameters, like the customer_id in the example above, you may create a Workflow triggered when a new customer is created with the Update field action that will generate the URL signature using the generateSignature() system function and store it in a custom field on the customer record:

Here, we're using the following target value for the Map link field that stores the shared map link that will be embedded into the customer portal:{{}}&signature={{generateSignature('customer_id=' +}}

3- If you're using dynamic URL parameters that become known only immediately before a shared link is loaded, use the /generateSignature Mapsly API endpoint with your Mapsly API key to generate a signature for an link with URL parameters at any moment.

Did this answer your question?