Skip to content

Auto center coordinate and zoom for multiple markers #2877

Answered by jaballogian
jaballogian asked this question in Q&A
Discussion options

You must be logged in to vote

Finally, I can use auto zoom and center with this library.

It's called bound animation.

After reading the Migration from [email protected] section from the documentation from the npm registry page here https://www.npmjs.com/package/@react-google-maps/api, I tried to combine the new way of calling the Google Map component for showing the map and initialize the bound then update the bound using the useEffect hook.

It worked.

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@komalharmale
Comment options

@zovanni
Comment options

Answer selected by jaballogian
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants