Skip to content

feat: use @googlemaps/js-api-loader#942

Closed
jpoehnelt wants to merge 2 commits intogoogle-map-react:masterfrom
jpoehnelt:feat/js-api-loader
Closed

feat: use @googlemaps/js-api-loader#942
jpoehnelt wants to merge 2 commits intogoogle-map-react:masterfrom
jpoehnelt:feat/js-api-loader

Conversation

@jpoehnelt
Copy link
Copy Markdown
Contributor

@jpoehnelt jpoehnelt commented Sep 17, 2020

Use @googlemaps/js-api-loader to dynamically load the Google Maps API.

also fixes #922

@itsmichaeldiego itsmichaeldiego self-requested a review September 18, 2020 08:29
Copy link
Copy Markdown
Member

@itsmichaeldiego itsmichaeldiego left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @jpoehnelt, this is great!! Thanks! I have two comments here:

  1. Will using the loader, fix the problem with chinese URL? #708
  2. We're deprecating heatmapLibrary, could we add something similar to what @aviyadeveloper's did here https://github.com/google-map-react/google-map-react/pull/934/files#diff-9a6a99e7dbcf49926535aa0d9547c3a0R62-R69 ?

Kind regards and thank you!!!

@jpoehnelt
Copy link
Copy Markdown
Contributor Author

  1. China is in the prohibited territories. I'll try to confirm if this is still correct.
  2. Updated the docs and added deprecation warning.

const BASE_URL = 'https://maps';
const DEFAULT_URL = `${BASE_URL}.googleapis.com`;
const API_PATH = '/maps/api/js?callback=_$_google_map_initialize_$_';
const { Loader } = require('@googlemaps/js-api-loader');
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we do import { Loader } from '@googlemaps/js-api-loader'; instead?

@itsmichaeldiego
Copy link
Copy Markdown
Member

@jpoehnelt Hey! I created a new PR with parts of your PR and some fixes, here it is #946, I kindly ask you if you can review it and let me know if its okey! Thanks.

@itsmichaeldiego
Copy link
Copy Markdown
Member

@jpoehnelt Merged in #946 and Released in version 2.1.4, let me know if you encounter any problems!

return loadPromise_;
if (!bootstrapURLKeys.libraries) {
bootstrapURLKeys.libraries = [];
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jpoehnelt Hey! Just wondering, why did we remove this line? I think this its causing this issue #954

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support to all libraries.

2 participants