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 fitBoundsOptions to MapGL component #334

Open
uf0 opened this issue Jul 9, 2021 · 1 comment
Open

Add fitBoundsOptions to MapGL component #334

uf0 opened this issue Jul 9, 2021 · 1 comment

Comments

@uf0
Copy link

uf0 commented Jul 9, 2021

Sice bounds option is exposed it would be nice to also have fitBoundsOptions

@uf0
Copy link
Author

uf0 commented Jul 9, 2021

Current workaround

const mapRef = useRef()

useEffect(() => {
  const map = mapRef.current.getMap()
  map.once('load', () => {
    map.fitBounds(bounds, { padding: 100 })
  })
}, [])
<MapGL
 ref={mapRef}
 .... 
 />

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

No branches or pull requests

1 participant