Skip to content

Commit 6414f7f

Browse files
committed
custom url via props
1 parent 5881174 commit 6414f7f

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/GoogleApiComponent.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@ const defaultCreateCache = (options) => {
1111
const libraries = options.libraries || ['places'];
1212
const version = options.version || '3.29';
1313
const language = options.language || 'en';
14+
const url = options.url;
1415

1516
return ScriptCache({
1617
google: GoogleApi({
1718
apiKey: apiKey,
1819
language: language,
1920
libraries: libraries,
20-
version: version
21+
version: version,
22+
url: url
2123
})
2224
});
2325
};

src/lib/GoogleApi.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export const GoogleApi = function(opts) {
99
const apiKey = opts.apiKey;
1010
const libraries = opts.libraries || ['places'];
1111
const client = opts.client;
12-
const URL = 'https://maps.googleapis.com/maps/api/js';
12+
const URL = opts.url || 'https://maps.googleapis.com/maps/api/js';
1313

1414
const googleVersion = opts.version || '3';
1515

0 commit comments

Comments
 (0)