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

FitBounds zooming out, issue when saving bounds to URL #1471

Closed
nkovacic opened this issue Aug 1, 2018 · 1 comment
Closed

FitBounds zooming out, issue when saving bounds to URL #1471

nkovacic opened this issue Aug 1, 2018 · 1 comment
Labels

Comments

@nkovacic
Copy link

nkovacic commented Aug 1, 2018

Issue description
When trying to save bounds to URL in the form of 2 coordinates (north east, south west) we have found out a bug when trying to recreate bounds on state reload.
Function map.fitBounds() sets the viewport to contain the bounds. But map.getBounds() function returns the viewport bounds with some extra margin (note that this is normal behaviour and no bug). The enlarged bounds no longer fits in the previous viewport, so the map zooms out.

Google Maps API v3 now supports a second padding argument that specifies the amount of padding to include around the bounds you specify.

Would it be possible to introduce an fitBoundsPadding directive so that this new padding argument could be used?

Additional information aboute the bug/feature on https://stackoverflow.com/questions/8170023/google-maps-api-3-zooms-out-on-fitbounds

angular2 & angular-google-maps version
1.0.0-beta.3

@stale
Copy link

stale bot commented Nov 13, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Nov 13, 2018
@stale stale bot closed this as completed Nov 20, 2018
ghost pushed a commit that referenced this issue Sep 16, 2019
add optional `fitBoundsPadding` property that when defined will be forwarded to the native maps `fitBounds` method.

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

No branches or pull requests

1 participant