-
AuthorPosts
-
July 4, 2018 at 12:20 pm #981121
shure this might be a paranoid solution – but i guess this is the only realy conform solution.
because you have to opt-in twice!you have to style the embedded map with enfold opt-in but the link to show the map isn’t there (even on hovering) if you do not agree to privacy policy:
See result here: https://webers-testseite.de/kontakt/just add to your child-theme functions.php
function googlemap_script() { ?> <script> (function($){ $('<label><input class="google-privacy" type="checkbox" /> yes - I have read the <a href="/datenschutzerklaerung">privacy policy</a> regarding Google Maps</label>').insertBefore('.av_gmaps_confirm_link'); $('a.av_gmaps_confirm_link.av_text_confirm_link').css( 'display' , 'none' ); $('.google-privacy:checkbox').prop('checked', false); $('.google-privacy:checkbox').click(function() { $('a.av_gmaps_confirm_link.av_text_confirm_link').toggle($(':checkbox:checked').length > 0); }); })(jQuery); </script> <?php } add_action('wp_footer', 'googlemap_script');
you have to edit the link to your privacy policy page in that code
July 4, 2018 at 12:40 pm #981135By the way – i like the use of lightbox and gmaps.
The thing you put in on a code-block element is something like this:
<h3> Google Map </h3> <label> <a class="googlemap" href="https://maps.google.de/maps?q=1+Ludwig-Schopp-Straße+27,+53117+Bonn,+Deutschland&hl=de&iframe=true"><img src="https://webers-testseite.de/wp-content/uploads/maps.png" alt="Google Map" /></a> </label>
the link in that code-block for your Address is concerning to Google: https://developers.google.com/maps/documentation/urls/guide
On German – with hl=de it will only work with :https://maps.google.de/maps?q=
and + (plus) separated Adress data.the code above must then be added additionally.
function googlemap_script() { ?> <script> (function($){ $('<label><input class="google-privacy" type="checkbox" /> yes - I have read the <a href="/datenschutzerklaerung">privacy policy</a> regarding Google Maps</label>').insertBefore('.av_gmaps_confirm_link'); $('<label><input class="google-privacy" type="checkbox" /> yes - I have read the <a href="/datenschutzerklaerung">privacy policy</a> regarding Google Maps</label>').insertBefore('a.googlemap'); $('a.googlemap').css( 'display' , 'none' ); $('a.av_gmaps_confirm_link.av_text_confirm_link').css( 'display' , 'none' ); $('.google-privacy:checkbox').prop('checked', false); $('.google-privacy:checkbox').click(function() { $('a.googlemap').toggle($(':checkbox:checked').length > 0); $('a.av_gmaps_confirm_link.av_text_confirm_link').toggle($(':checkbox:checked').length > 0); }); })(jQuery); </script> <?php } add_action('wp_footer', 'googlemap_script');
Big advantage – you wouldn’t even need a Google Api key for this – and bypasses the new payment method of Google as well
July 5, 2018 at 10:07 pm #981754Hi,
Thanks for providing your code. I’m sure this will help some other users!
Best regards,
Dude -
AuthorPosts
- You must be logged in to reply to this topic.