@@ -3,20 +3,20 @@ var _ = require('lodash');
3
3
// var shared = require('./shared');
4
4
var debug = require ( 'debug' ) ( 'scout:minicharts:geo' ) ;
5
5
var mapStyle = require ( './mapstyle' ) ;
6
- var async = require ( 'async' ) ;
7
- var xor = require ( 'xor-it' ) ;
6
+ // var async = require('async');
7
+ // var xor = require('xor-it');
8
8
var app = require ( 'ampersand-app' ) ;
9
9
var format = require ( 'util' ) . format ;
10
10
11
11
12
12
var SHIFTKEY = 16 ;
13
- var APIKEY = '\u0004;\b\u000e!Cd5\u0007*V\u001d\u0007C\u0003/9HW\u001c>_\u0010\u0017)*\u0017B.7D/!*3\u000f\bX\u0010 ' ;
13
+ var APIKEY = 'AIzaSyDrhE1qbcnNIh4sK3t7GEcbLRdCNKWjlt0 ' ;
14
14
15
- function produceKey ( text ) {
16
- var key = 'Error: Google map could not be loaded, disabling feature' ;
17
- var res = xor ( key , text ) ;
18
- return res ;
19
- }
15
+ // function produceKey(text) {
16
+ // var key = 'Error: Google map could not be loaded, disabling feature';
17
+ // var res = xor(key, text);
18
+ // return res;
19
+ // }
20
20
21
21
// From: http://davidbcalhoun.com/2014/async.parallel-with-a-simple-timeout-node-js/
22
22
// async.parallel with optional timeout (options.timeoutMS)
@@ -60,7 +60,9 @@ var minicharts_d3fns_geo = function() {
60
60
// var margin = shared.margin;
61
61
62
62
function disableMapsFeature ( ) {
63
+ // disable both in feature flag (for this run) and localStorage
63
64
app . setFeature ( 'Google Map Minicharts' , false ) ;
65
+ localStorage . disableGoogleMaps = true ;
64
66
delete window . google ;
65
67
debug ( 'parent render' , options . view . parent . render ( ) ) ;
66
68
options . view . parent . render ( ) ;
@@ -83,7 +85,7 @@ var minicharts_d3fns_geo = function() {
83
85
var script = document . createElement ( 'script' ) ;
84
86
script . setAttribute ( 'type' , 'text/javascript' ) ;
85
87
script . src = format ( 'https://maps.googleapis.com/maps/api/js?key=%s&libraries=geometry' ,
86
- produceKey ( APIKEY ) ) ;
88
+ APIKEY ) ;
87
89
script . onerror = function ( ) {
88
90
done ( 'Error ocurred while loading Google Maps.' ) ;
89
91
} ;
0 commit comments