• Hi,

    How can I add my google map on contact page to show only when users accept cookies? Sadly google maps loads a lot of cookies. I think this could be done somehow with using divs (or somehow else)?

    Is it possible to show this notification message all the time to users who didn’t accept terms or who didn’t allow to load cookies?

    Kind regards

    https://www.ads-software.com/plugins/cookillian/

Viewing 1 replies (of 1 total)
  • Thread Starter ninostar78

    (@ninostar78)

    The code below is working in sample HTML page, but not when I load it in Cookillian plugin… I’ve added div #map_canvas to theme’s css, added same div id tag to my contact page and added both scripts in header area (in Cookillian dashboard).

    So why doesn’t google map load on my website, but it loads on simply html page on my computer?!?

    <!DOCTYPE html>
    <html>
    <head>
        <title>Simple Map</title>
        <meta name="viewport" content="initial-scale=1.0, user-scalable=no">
        <meta charset="utf-8">
      <style>
      html, body, #map_canvas { margin: 0; padding: 0; height: 350px; width: 100%; }
        </style>
      <script src="https://maps.googleapis.com/maps/api/js?key=MY_KEY&sensor=false"></script>
        <script>
    var map;
    function initialize() {
      var mapOptions = {
        zoom: 8,
        center: new google.maps.LatLng(-34.397, 150.644),
        mapTypeId: google.maps.MapTypeId.ROADMAP
      };
      map = new google.maps.Map(document.getElementById('map_canvas'),
          mapOptions);
    }
    
    google.maps.event.addDomListener(window, 'load', initialize);
    
        </script>
      </head>
      <body>
      <div id="map_canvas"></div>
    </body>
Viewing 1 replies (of 1 total)
  • The topic ‘Google maps’ is closed to new replies.