1002Studio 10 лет назад
Родитель
Сommit
d4c78ba156
1 измененных файлов с 26 добавлено и 1 удалено
  1. 26 1
      tarteaucitron.services.js

+ 26 - 1
tarteaucitron.services.js

@@ -1,4 +1,4 @@
-/*global tarteaucitron, ga, Shareaholic, stLight, clicky, top*/
+/*global tarteaucitron, ga, Shareaholic, stLight, clicky, top, google*/
 /*jslint regexp: true, nomen: true*/
 
 // addthis
@@ -326,6 +326,31 @@ tarteaucitron.services.analytics = {
     }
 };
 
+// google maps
+tarteaucitron.services.googlemaps = {
+    "key": "googlemaps",
+    "type": "api",
+    "name": "Google Maps",
+    "uri": "http://www.google.com/ads/preferences/",
+    "needConsent": true,
+    "cookies": [],
+    "js": function () {
+        "use strict";
+        if (tarteaucitron.user.googlemapsApiKey === undefined) {
+            return;
+        }
+        tarteaucitron.addScript('//maps.googleapis.com/maps/api/js?v=3.exp&signed_in=true&callback=tarteaucitron_googlemaps&key=' + tarteaucitron.user.googlemapsApiKey);
+    },
+    "fallback": function () {
+        "use strict";
+        var id = 'googlemaps';
+        
+        if (document.getElementById('tac_map-canvas')) {
+            document.getElementById('tac_map-canvas').innerHTML = tarteaucitron.engage(id);
+        }
+    }
+};
+
 // jsapi
 tarteaucitron.services.jsapi = {
     "key": "jsapi",