Thread Starter
hupe13
(@hupe13)
Ok, it may be, that this was a configuration or caching problem. I checked all settings again, now the most work. But the Gesture Handling problem remains.
Thread Starter
hupe13
(@hupe13)
It is a setting problem: If I set “Respect Do Not Track and Global Privacy Control?” to yes, the problems occur again. If this setting is no, all except Gesture Handling works.
Hi @hupe13,
I expect that when another Map variant is used, elevation for example, it results in an additional JavaScript file/dependency being loaded, which will also have to be blocked in the integration file.
Otherwise the elevation script would be loaded while the others are still blocked, resulting in a failure for the Map to initialize correctly. I see that the current ‘leaflet’ integration doesn’t correctly block all of those scripts and dependencies.
Could you try replacing the Leaflet integration with the below version? I haven’t verified it myself yet, but this version also blocks the Leaflet Extensions and tells them to wait for the “main” Leaflet script to load.
<?php
defined( 'ABSPATH' ) or die( "you do not have access to this page!" );
add_filter( 'cmplz_known_script_tags', 'cmplz_leafletmaps_directory_script' );
function cmplz_leafletmaps_directory_script( $tags ) {
$tags[] = array(
'name' => 'openstreetmaps',
'category' => 'marketing',
'placeholder' => 'openstreetmaps',
'urls' => array(
'WPLeafletMapPlugin',
'leaflet-gesture-handling',
'extensions-leaflet-map',
),
'enable_placeholder' => '1',
'placeholder_class' => 'leaflet-map',
'enable_dependency' => '1',
'dependency' => [
//'wait-for-this-script' => 'script-that-should-wait'
'WPLeafletMapPlugin' => 'leaflet-gesture-handling',
'WPLeafletMapPlugin' => 'extensions-leaflet-map',
],
);
return $tags;
}
/**
* Add services to the list of detected items, so it will get set as default, and will be added to the notice about it
*
* @param $services
*
* @return array
*/
function cmplz_leafletmaps_directory_detected_services( $services ) {
if ( ! in_array( 'openstreetmaps', $services ) ) {
$services[] = 'openstreetmaps';
}
return $services;
}
add_filter( 'cmplz_detected_services', 'cmplz_leafletmaps_directory_detected_services' );
Let me know if that does the trick!
Kind regards, Jarno
Thread Starter
hupe13
(@hupe13)
'dependency' => [
//'wait-for-this-script' => 'script-that-should-wait'
'WPLeafletMapPlugin' => 'leaflet-gesture-handling',
'WPLeafletMapPlugin' => 'extensions-leaflet-map',
],
What must be inserted for “script-that-should-wait”? The plugin slug, the name of the js file or the path of the js file or what?
Hi @hupe13,
Any unique identifier that is present in the script that should be blocked (this could be a part of the filename/the full filename, or a part of the path etc).
I used the folder name of your plugin (/extensions-leaflet-map/) as the identifier, so the integration is not dependent on the extension’s file name, but would trigger on any script that contains the extensions-leaflet-mapfolder name.
Kind regards, Jarno
-
This reply was modified 3 years, 3 months ago by
Jarno Vos.
Hi @hupe13,
I can additionally recommend this article, which provides a more in-depth explanation about the creation of custom integrations: https://complianz.io/custom-google-maps-implementation/
Kind regards, Jarno
Thread Starter
hupe13
(@hupe13)
You don’t need any dependency configurations. I changed the script:
<?php
defined( 'ABSPATH' ) or die( "you do not have access to this page!" );
function cmplz_leafletmaps_directory_script( $tags ) {
$tags[] = array(
'name' => 'openstreetmaps',
'category' => 'marketing',
'placeholder' => 'openstreetmaps',
'urls' => array(
'WPLeafletMapPlugin',
),
'enable_placeholder' => '1',
'placeholder_class' => 'leaflet-map',
'enable_dependency' => '0',
'dependency' => [
//'wait-for-this-script' => 'script-that-should-wait'
],
);
return $tags;
}
add_filter( 'cmplz_known_script_tags', 'cmplz_leafletmaps_directory_script' );
/**
* Add services to the list of detected items, so it will get set as default, and will be added to the notice about it
*
* @param $services
*
* @return array
*/
function cmplz_leafletmaps_directory_detected_services( $services ) {
if ( ! in_array( 'openstreetmaps', $services ) ) {
$services[] = 'openstreetmaps';
}
return $services;
}
add_filter( 'cmplz_detected_services', 'cmplz_leafletmaps_directory_detected_services' );
And I changed my code for Gesture Handling, now it works.
But I still have problems with “Do not track” and setting “Respect Do Not Track and Global Privacy Control?” to yes. On the page with the first map I agree, the page is displayed. When I go to the next page or load the same page again, the banner appears and I can’t continue.
Hi @hupe13,
I see what you’re referring to. I’ve replicated that behavior on a sandbox environment, and we’re looking into it as we speak.
Kind regards, Jarno
Hello @hupe13,
Please install this version of Complianz, it will fix the described DNT issue: https://github.com/Really-Simple-Plugins/complianz-gdpr/tree/DNT-on-embedded-content
The cmplz_has_consent function returned ‘false’ in case of DNT, but when the user contents to embedded content, there is consent; and that is what caused the issue to occur.
Curious to hear about your findings with this version.
Kind regards, Jarno
Thread Starter
hupe13
(@hupe13)
Hello @jarnovos,
it works now. Thank you very much.
But I’m having trouble with a very specific page, I’ve tried to solve it but I can’t manage it. The page loads javascript from a file. But I get Javascript errors if Complianz is active and the fields remain empty. Maybe you know a solution.
Hi @hupe13,
Would it be possible for you to temporarily re-enable Complianz on the page in question, so that we can take a closer look at the JS errors that appear in the console?
Kind regards, Jarno
Thread Starter
hupe13
(@hupe13)
I made a test site with Complianz enabled.
Plugin Author
Aert
(@aahulsebos)
Hi @hupe13,
This does look like a dependency error. Please contact complianz.io/contact/ and mention this thread an that you’re a developer of this plugin, so we can work together more easily.
Thanks, regards Aert
Thread Starter
hupe13
(@hupe13)
It works now. Thank you very much.