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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add map_id parameter to static map request #270

Merged
merged 2 commits into from
May 31, 2023

Conversation

rockaport
Copy link
Contributor

@rockaport rockaport commented Jul 22, 2022

Add support for map_id parameter to static map request and static map cli app


Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open a GitHub issue as a bug/feature request before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #269 馃

@@ -37,6 +37,7 @@ var (
scale = flag.Int("scale", -1, "Scale affects the number of pixels that are returned.")
format = flag.String("format", "", "Format defines the format of the resulting image.")
maptype = flag.String("maptype", "", "Maptype defines the type of map to construct.")
mapid = flag.String("mapid", "", "MapId defines the mapid to use.")

Choose a reason for hiding this comment

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

Naming convention for the majority of these is to exclude the map prefix even though they are map values. I think it would make sense and read better to use just id instead of mapi.

It would also be nice for the description to talk about what id does rather than just letting us know it's a 1:1 pass through to the API. Maybe this line taken from the API docs: associates a map with a particular style or feature

Copy link

Choose a reason for hiding this comment

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

I forgot this PR was still open...

I followed the existing code convention. See maptype above. Besides, it's the name of the variable in the request in the static maps API docs. I didn't want to take the liberty of changing variable names given all the others are 1:1 matches.

As for the description, I figured anyone using this library would refer to the API docs if something is unclear.

@nwneisen
Copy link

I'm also interested in adding this parameter. I looked over the PR and gave my 0.02$ if that helps merge the change at all.

@rockaport
Copy link
Contributor Author

Please merge

@amuramoto amuramoto closed this May 31, 2023
@amuramoto amuramoto reopened this May 31, 2023
@amuramoto amuramoto merged commit d89ccbc into googlemaps:master May 31, 2023
4 checks passed
@googlemaps-bot
Copy link
Contributor

馃帀 This PR is included in version 1.5.0 馃帀

The release is available on GitHub release

Your semantic-release bot 馃摝馃殌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Static maps map_id parameter support
6 participants