mirror of
https://github.com/google-map-react/google-map-react.git
synced 2025-12-08 18:26:32 +00:00
Updated China base url (#827)
This commit is contained in:
parent
acad4b79d4
commit
42617c99c3
@ -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)'))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user