Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for usage from China #494

Merged
merged 4 commits into from Jan 18, 2018

Conversation

emilpalsson
Copy link
Contributor

Use China specific API URL if setting bootstrapURLKeys.region to 'cn'.

Fixes #493

Copy link

@nicolasdelfino nicolasdelfino left a comment

Choose a reason for hiding this comment

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

Looks good, I approve

@itsmichaeldiego
Copy link
Member

@emilpalsson Thanks for this, it is looking good, would you mind adding this to the docs? As soon as you do that I will release a new version fixing this.

@@ -62,8 +62,12 @@ export default function googleMapLoader(bootstrapURLKeys) {
''
);

const url = bootstrapURLKeys.region === 'cn'
Copy link
Contributor

Choose a reason for hiding this comment

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

what about other regions ?

Copy link
Member

Choose a reason for hiding this comment

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

@jooj123 I believe the only region that has a problem with this is China. But we could confirm

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Exactly, China is the only region mentioned on the Google Maps FAQ (see link in the issue), and the only region I've experienced problems with.

@emilpalsson
Copy link
Contributor Author

@itsmichaeldiego Great! Of course, I'll see if I can find a good spot for this in the docs right now.

@emilpalsson
Copy link
Contributor Author

@itsmichaeldiego I've added this to the docs, let me know if you want me to structure it differently. I also added a toLocaleLowerCase() for case insensitivity.

Copy link
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.

Great work dude!

@itsmichaeldiego itsmichaeldiego merged commit 1a60df0 into google-map-react:master Jan 18, 2018
@emilpalsson emilpalsson deleted the Iss493-china-url branch January 19, 2018 07:21
@romanenko
Copy link

Looks like that if region is not set — it leads to uncaught Error now, with 0.28.0 release

image

I'm setting up my GoogleMap component like this:

      <GoogleMap
        bootstrapURLKeys={{
          key: GOOGLE_MAPS_API_KEY,
          language: intl.locale,
        }}
//...

@emilpalsson
Copy link
Contributor Author

emilpalsson commented Jan 19, 2018

@romanenko Yes, I'm sorry for this. There is already a new PR to fix this (#496).

@lock
Copy link

lock bot commented Dec 1, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Dec 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Usage from China requires different API URL
5 participants