Skip to content

Commit

Permalink
Fix: Fix a timing issue for sequential importLibrary calls (#843)
Browse files Browse the repository at this point in the history
  • Loading branch information
googlemaps-bot committed Apr 26, 2024
1 parent 2c490bb commit b8d3c8e
Show file tree
Hide file tree
Showing 12 changed files with 55 additions and 52 deletions.
36 changes: 18 additions & 18 deletions classes/Loader.html

Large diffs are not rendered by default.

12 changes: 7 additions & 5 deletions dist/index.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -422,19 +422,21 @@ this.google.maps.plugins.loader = (function (exports) {
}
execute() {
this.resetIfRetryingFailed();
if (this.loading) {
// do nothing but wait
return;
}
if (this.done) {
this.callback();
} else {
// short circuit and warn if google.maps is already loaded
if (window.google && window.google.maps && window.google.maps.version) {
console.warn("Google Maps already loaded outside @googlemaps/js-api-loader." + "This may result in undesirable behavior as options and script parameters may not match.");
console.warn("Google Maps already loaded outside @googlemaps/js-api-loader. " + "This may result in undesirable behavior as options and script parameters may not match.");
this.callback();
return;
}
if (this.loading) ; else {
this.loading = true;
this.setScript();
}
this.loading = true;
this.setScript();
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion dist/index.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 7 additions & 6 deletions dist/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -385,22 +385,23 @@ class Loader {
}
execute() {
this.resetIfRetryingFailed();
if (this.loading) {
// do nothing but wait
return;
}
if (this.done) {
this.callback();
}
else {
// short circuit and warn if google.maps is already loaded
if (window.google && window.google.maps && window.google.maps.version) {
console.warn("Google Maps already loaded outside @googlemaps/js-api-loader." +
console.warn("Google Maps already loaded outside @googlemaps/js-api-loader. " +
"This may result in undesirable behavior as options and script parameters may not match.");
this.callback();
return;
}
if (this.loading) ;
else {
this.loading = true;
this.setScript();
}
this.loading = true;
this.setScript();
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion dist/index.mjs.map

Large diffs are not rendered by default.

Loading

0 comments on commit b8d3c8e

Please sign in to comment.