Skip to content

Commit d134bba

Browse files
committed
Merge pull request #68 from bamnet/master
Warn if no identifier used loading maps
2 parents 6b0a3b0 + 0a1fdf4 commit d134bba

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

google-maps-api.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,14 @@
122122
url += '&client=' + clientId;
123123
}
124124

125+
// Log a warning if the user is not using an API Key or Client ID.
126+
if (!apiKey && !clientId) {
127+
var warning = 'No Google Maps API Key or Client ID specified. ' +
128+
'See https://developers.google.com/maps/documentation/javascript/get-api-key ' +
129+
'for instructions to get started with a key or client id.';
130+
console.warn(warning);
131+
}
132+
125133
if (language) {
126134
url += '&language=' + language;
127135
}

0 commit comments

Comments
 (0)