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
Add support for Google Maps API For Work params #45
Add support for Google Maps API For Work params #45
Conversation
|
||
return queryStrBuffer.String(), nil | ||
} else if GoogleClientID != "" && GooglePrivateKey != "" { | ||
queryStrBuffer := bytes.NewBufferString(queryStr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if it makes sense to break these out into separate functions for building a URL depending on the authentication schema, be it API key or Business ClientId and PrivateKey.
Something like:
buildGoogleMapsClientSideQuery(params string) (string, error)
buildGoogleMapsForWorkQuery(params string) (string, error)
buildDefaultGoogleMapsQuery() (string)
Heya! Thanks for taking the time to make Pull Request 😄 , I appreciate it!! This is definitely a change I can see benefitting a lot of people, so thanks for doing it! This is a relatively big change, and as such, I had a few thoughts before proceeding. I left a few comments inline, let me know what you think! Making geocoder implementations has been the biggest source of PRs for this lib, and admittedly, it's the place that needs the most love. A few of these were made in haste without considering how other people might use them, or using different auth schemas. As such, I want to use this opportunity to clean up things a bit so we can have the cleanest implementation as possible! Thanks again! |
Thanks for the feedback! I agree I didn't really clean up the code when changing it, I'll try to refactor this properly using an Auth Schema param. |
Hello, I refactored the code to add your proposed |
Hello, did you have time to review the changes? Anything else I can do to help? |
@skateinmars heya! Sorry for the delay in responding, it's been a busy week or so for me. I'm still making a decision on how to handle the backwards compatible changes. I started writing up a set of features I'd like to see in a v1.0.0 release of I think your work might be a good starting point to create a That being said, I might hold off on introducing your featureset into How do you feel about that? |
Hello, I agree we shouldn't merge this to master since there are incompatible changes. |
Awesome! I've created a new branch, I'll close this PR for now. @skateinmars, Would you mind opening up a new PR against the new Thanks! |
The Maps API can be used with a Google business account but this require a different authentication method than a simple API key and request URL signing.
This Pull Request adds support for this auth method based on the documentation provided here: https://developers.google.com/maps/documentation/business/webservices/auth
I reused the same
GoogleGeocoder
but added 3 new vars and their matching configuration functions.