Skip to content

Commit 0a1fdf4

Browse files
committed
Log a warning if the Google Maps API is loaded without an API Key or Client ID.
Closes GoogleWebComponents/google-map#260.
1 parent 6b0a3b0 commit 0a1fdf4

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)