You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I specify defaultBounds I would expect it to fit the bounds such that calling fitBounds afterward has no effect. I have found this is only true when isFractionalZoomEnabled={true}. Without that, the initial map wouldn't match the fitBounds call, so when I 'reset' the map state (calling fitBounds) it would differ to the initial state.
I mention this because it took me hours to figure out. To be fair I'm not a Google Maps expert, but I tried lots of different approaches and I couldn't find any other way to make the map initialize to the correct bounds. (Manually calling fitBounds does. But when? And it's time dependent - if you do it too early in the load it fails. What about onIdle / onBoundsChanged? Works but how to do so without blocking user interaction? Etc.) So, unless I'm missing something, it'd be really good to have a warning or something in the console, or default to isFractionalZoomEnabled={true} if you specify defaultBounds.
Steps to Reproduce
I can provide if needed, but I'm hoping someone understands the root of the issue without testing, as it's relatively straightforward.
Environment
Library version: 9.0.29
Google maps version: ?
Browser and Version: Edge 129.0.2792.89 (Official build) (64-bit)
OS: Windows
Logs
No response
The text was updated successfully, but these errors were encountered:
In this example it looks to me like it is behaving consistently correct. Are you seeing the issue here as well? The bounds are different depending on isFractionalZoomEnabled={true/false} but that makes sense since the when using false the map can can only use whole number zoom levels. But either way it looks to be consistent and I'm not seeing any jumps.
Can you provide a running example where you are seeing the issue?
Description
When I specify
defaultBounds
I would expect it to fit the bounds such that callingfitBounds
afterward has no effect. I have found this is only true whenisFractionalZoomEnabled={true}
. Without that, the initial map wouldn't match thefitBounds
call, so when I 'reset' the map state (callingfitBounds
) it would differ to the initial state.I mention this because it took me hours to figure out. To be fair I'm not a Google Maps expert, but I tried lots of different approaches and I couldn't find any other way to make the map initialize to the correct bounds. (Manually calling
fitBounds
does. But when? And it's time dependent - if you do it too early in the load it fails. What about onIdle / onBoundsChanged? Works but how to do so without blocking user interaction? Etc.) So, unless I'm missing something, it'd be really good to have a warning or something in the console, or default toisFractionalZoomEnabled={true}
if you specifydefaultBounds
.Steps to Reproduce
I can provide if needed, but I'm hoping someone understands the root of the issue without testing, as it's relatively straightforward.
Environment
Logs
No response
The text was updated successfully, but these errors were encountered: