From 6da256112096af891a2ad7766a644c1c00d304d9 Mon Sep 17 00:00:00 2001 From: Nitya Date: Fri, 23 Feb 2024 23:17:08 -0500 Subject: [PATCH 1/2] load maps async --- .../react-google-maps-api/src/utils/make-load-script-url.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/react-google-maps-api/src/utils/make-load-script-url.ts b/packages/react-google-maps-api/src/utils/make-load-script-url.ts index 16cfb96c3..03857cc02 100644 --- a/packages/react-google-maps-api/src/utils/make-load-script-url.ts +++ b/packages/react-google-maps-api/src/utils/make-load-script-url.ts @@ -67,6 +67,8 @@ export function makeLoadScriptUrl({ params.push(`auth_referrer_policy=${authReferrerPolicy}`) } + //Need to load api asynchronously. Ref: https://developers.google.com/maps/documentation/javascript/overview + params.push('loading=async') params.push('callback=initMap') return `https://maps.googleapis.com/maps/api/js?${params.join('&')}` From b250713d46abf6327971dc61e0f798a0864e7fba Mon Sep 17 00:00:00 2001 From: Nitya Date: Fri, 23 Feb 2024 23:24:45 -0500 Subject: [PATCH 2/2] removed comment --- .../react-google-maps-api/src/utils/make-load-script-url.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/react-google-maps-api/src/utils/make-load-script-url.ts b/packages/react-google-maps-api/src/utils/make-load-script-url.ts index 03857cc02..3a3fd80d1 100644 --- a/packages/react-google-maps-api/src/utils/make-load-script-url.ts +++ b/packages/react-google-maps-api/src/utils/make-load-script-url.ts @@ -67,8 +67,7 @@ export function makeLoadScriptUrl({ params.push(`auth_referrer_policy=${authReferrerPolicy}`) } - //Need to load api asynchronously. Ref: https://developers.google.com/maps/documentation/javascript/overview - params.push('loading=async') + params.push('loading=async') params.push('callback=initMap') return `https://maps.googleapis.com/maps/api/js?${params.join('&')}`