Updated China base url (#827)

This commit is contained in:
Eniz Gülek 2020-01-27 18:51:13 +03:00 committed by Michael Diego
parent acad4b79d4
commit 42617c99c3

View File

@ -2,13 +2,6 @@ const BASE_URL = 'https://maps';
const DEFAULT_URL = `${BASE_URL}.googleapis.com`;
const API_PATH = '/maps/api/js?callback=_$_google_map_initialize_$_';
const getUrl = region => {
if (region && region.toLowerCase() === 'cn') {
return `${BASE_URL}.google.cn`;
}
return DEFAULT_URL;
};
let $script_ = null;
let loadPromise_;
@ -70,11 +63,10 @@ export default (bootstrapURLKeys, heatmapLibrary) => {
''
);
const baseUrl = getUrl(bootstrapURLKeys.region);
const libraries = heatmapLibrary ? '&libraries=visualization' : '';
$script_(
`${baseUrl}${API_PATH}${params}${libraries}`,
`${DEFAULT_URL}${API_PATH}${params}${libraries}`,
() =>
typeof window.google === 'undefined' &&
reject(new Error('google map initialization error (not loaded)'))