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

Add padding option to defaultBounds #392

Merged
merged 3 commits into from
May 30, 2024
Merged

Conversation

francescocretti
Copy link
Contributor

As discussed in issue #391, this PR adds the optional padding property to defaultBounds.

e.g.

    <Map
      defaultBounds={{
        west: -7.521054546833144,
        north: 57.18946776545227,
        south: 49.60181300450985,
        east: -2.8939254862738877,
        padding: {
          bottom: 50,
          right: 50,
        }
      }}
    />

NOTE
The Google Maps API implement a system of discreet zoom levels, so some values of padding could not be visible if they don't reach the smallest amount of padding necessary to cause the zoom level to change by a full integer value. More info: https://stackoverflow.com/a/44476181

@usefulthink
Copy link
Collaborator

That was fast, thanks a lot! I'll merge that later today for the 1.1.0 version, I still have a fix for 1.0.2 to do before that..

@francescocretti
Copy link
Contributor Author

@usefulthink no problem ;) thanks for your work. Let me know if changes are needed!

@usefulthink usefulthink merged commit 9dc65dc into visgl:main May 30, 2024
2 checks passed
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.

None yet

2 participants