File tree Expand file tree Collapse file tree 3 files changed +16
-12
lines changed Expand file tree Collapse file tree 3 files changed +16
-12
lines changed Original file line number Diff line number Diff line change 27
27
"deploy" : " gh-pages -d example/build"
28
28
},
29
29
"dependencies" : {
30
- "@googlemaps/js-api-loader" : " ^1.4 .0" ,
30
+ "@googlemaps/js-api-loader" : " ^1.7 .0" ,
31
31
"@mapbox/point-geometry" : " ^0.1.0" ,
32
32
"eventemitter3" : " ^4.0.4" ,
33
33
"prop-types" : " ^15.7.2"
50
50
"eslint-plugin-react" : " ^7.17.0" ,
51
51
"eslint-plugin-standard" : " ^4.0.1" ,
52
52
"expect" : " 1.20.2" ,
53
- "jsdom" : " ^6.5.1" ,
54
53
"gh-pages" : " ^2.2.0" ,
54
+ "jsdom" : " ^6.5.1" ,
55
55
"microbundle-crl" : " ^0.13.10" ,
56
56
"npm-run-all" : " ^4.1.5" ,
57
57
"prettier" : " ^2.0.4" ,
Original file line number Diff line number Diff line change 1
1
import { Loader } from '@googlemaps/js-api-loader' ;
2
2
3
+ let loader_ ;
3
4
let loadPromise_ ;
4
5
let resolveCustomPromise_ ;
5
6
@@ -56,12 +57,15 @@ export default (bootstrapURLKeys, heatmapLibrary) => {
56
57
57
58
const { key, ...restKeys } = bootstrapURLKeys ;
58
59
59
- const loader_ = new Loader ( {
60
- // need to keep key for backwards compatibility
61
- apiKey : key || '' ,
62
- ...restKeys ,
63
- libraries,
64
- } ) ;
60
+ // use single instance of Loader to avoid multiple api loads
61
+ if ( ! loader_ ) {
62
+ loader_ = new Loader ( {
63
+ // need to keep key as a prop for backwards compatibility
64
+ apiKey : key || '' ,
65
+ ...restKeys ,
66
+ libraries,
67
+ } ) ;
68
+ }
65
69
66
70
loadPromise_ = loader_ . load ( ) . then ( ( ) => {
67
71
resolveCustomPromise_ ( window . google . maps ) ;
Original file line number Diff line number Diff line change 1199
1199
resolved "https://registry.yarnpkg.com/@csstools/normalize.css/-/normalize.css-10.1.0.tgz#f0950bba18819512d42f7197e56c518aa491cf18"
1200
1200
integrity sha512-ij4wRiunFfaJxjB0BdrYHIH8FxBJpOwNPhhAcunlmPdXudL1WQV1qoP9un6JsEBAgQH+7UXyyjh0g7jTxXK6tg==
1201
1201
1202
- "@googlemaps/js-api-loader@^1.4 .0":
1203
- version "1.4 .0"
1204
- resolved "https://registry.yarnpkg.com/@googlemaps/js-api-loader/-/js-api-loader-1.4 .0.tgz#2dcfc22c25fb295596046c3120d870de686aae77 "
1205
- integrity sha512-WVGfV0AINBFdpBt+qgtQe2H2KWDpH0snXTeIZID2YgGo5bSNKxjaFqiw96Ma19oupTWr9B1ud+6j4xhHe/BMWA ==
1202
+ "@googlemaps/js-api-loader@^1.7 .0":
1203
+ version "1.7 .0"
1204
+ resolved "https://registry.yarnpkg.com/@googlemaps/js-api-loader/-/js-api-loader-1.7 .0.tgz#d134f4a1bb8d1d864a5da41329da67b192acfa6b "
1205
+ integrity sha512-6DkHnfFh81qcez8j8CEG8C3ANvA+3dbOzo8Hg9/DuNI78h36ILquUUuwUG6JHiRvPbqBG146rLDFSympUuO+6Q ==
1206
1206
1207
1207
"@hapi/address@2.x.x":
1208
1208
version "2.1.4"
You can’t perform that action at this time.
0 commit comments