Concluding on this issue, please find my details below.
There will be no inhouse consent mechanism for this in Toolset.
There are possibilities to resolve this either with Custom Code, with Toolset and little HTML + JS, or 3rd Party Software abd API.
Below 2 propose solutions.
### Approach 1, Paid Pro solution
1. Install [GDPR Cookie Consent PRO](versteckter Link) plugin. It allows you to block Google Maps scripts in its settings. Additionally, you will need to block a few more scripts of Toolset Maps, by adding this to your Theme's functions.php:
function scripts_list() {
$scripts = array(
array(
'id' => 'toolsetmaps',
'label' => 'Toolset Maps',
'key' => array('wp-content/plugins/toolset-maps/resources/js/wpv_addon_maps.js', 'wpv_addon_maps.js', 'wpv_addon_maps', 'wpv-addon-maps'),
'category' => 'maps',
'status' => 'yes'
)
);
return $scripts;
}
add_filter('cli_extend_script_blocker', 'scripts_list', 10, 1);
See versteckter Link API doc of the GDPR Cookie Consent PRO plugin.
2. Create a new GDPR Cookie Consent PRO plugin “Cookie category”, to which both Google Maps and Toolset maps scripts (blocked) have to be connected, see their DOC:
versteckter Link
3. Create a new GDPR Cookie Consent PRO plugin “Cookie”, connected that to above cookie category. Duration and type is “session” and sensitivity is “necessary”.
This will allow visitors to turning off and on maps scripts as they like, and maps will only display/load scripts if allowed.
---
### Approach 2, Toolset and Custom HTML/JS solution
1. Create a CT that is not assigned anywhere, it will be your “consent” form, so to say.
2. In that Content Template, you insert a custom HTML Consent Form. However you will design it is up to you, below a minimal example to get approval or denial from visitors and store that as a cookie valid for 30 days. of course, this is all up to Webmaster:
<form>
<select name='ts_maps_consent'>
<option value="yes">Yes</option>
<option value="no">No</option>
</select>
<input type="button" value="Go!" id="submit" onclick="putCookie(document.getElementsByTagName('form'));">
</form>
3. Add some JS to the CT, to set the cookie according what visitors will select in above form:
//Set cookie validity time
var today = new Date();
var expiry = new Date(today.getTime() + 30 * 24 * 3600 * 1000); // plus 30 days
//Set cookie function, fired later when submitting form
function setCookie(name, value){
document.cookie=name + "=" + escape(value) + "; path=/; expires=" + expiry.toGMTString();
}
//When form is submitted
function putCookie(form){
//Set our cookie
setCookie("ts_maps_consent", form[0].ts_maps_consent.value);
//hardreload page
window.location.reload();
return true;
}
4. You just created your Consent form. Now you need to (wherever you want clients to interact with it) insert this wrapped in an HTML Conditional, like:
[wpv-conditional if="( '[ts-generic-get-cookie-value]' eq 'yes' )"]
[wpv-map-render map_id="map-id"][/wpv-map-render]
[/wpv-conditional]
[wpv-conditional if="( '[ts-generic-get-cookie-value]' ne 'yes' )"]
[wpv-post-body view_template="consent"]
[/wpv-conditional]
When you now visit the page where this is inserted, you will be asked to approve the scripts in the select. Submit, the page reloads and you will see the map.
Of course, this is a very minimal implementation but it shows how you can set ANY consent using Toolset.
Please let me know if there are any doubts on the issue left.
I also want to forward our appreciation for the patience and resolution of the particular issue you have shared here.
Thank you!