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
First off, thank you for this wonderful library, it's powerful, performant, and easy to use. I'm currently experiencing some inconsistent behavior with the fitBounds method. I've observed the issue in my own code as well as the react-map-gl hosted example here: https://visgl.github.io/react-map-gl/examples/zoom-to-bounds
If you watch the attached screen recording you'll notice the final position and zoom is different depending on the current view and where in the interactiveLayer the click happened. It always works correctly if you zoom the map out sufficiently before clicking a region.
Screen.Recording.2024-10-21.at.7.28.30.AM.mp4
I've worked around the issue by using the polygon from the original geoJson I'm loading to set the bounding box but it would be nice not to have to do that additional lookup as I believe the correct data should exist inside the onMapClick event's data.
Expected Behavior
I'd expect the MapLayerMouseEvent.features to be the same every time when clicking into the same interactive layer.
Steps to Reproduce
Pull this repo, and run the "zoom-to-bounds" example, add a line inside the onMapClick event to console the event.features[0].geometry.coordinates[0].flat() and observe different values returned when clicking at different points within the same feature.
Description
First off, thank you for this wonderful library, it's powerful, performant, and easy to use. I'm currently experiencing some inconsistent behavior with the
fitBounds
method. I've observed the issue in my own code as well as the react-map-gl hosted example here: https://visgl.github.io/react-map-gl/examples/zoom-to-boundsIf you watch the attached screen recording you'll notice the final position and zoom is different depending on the current view and where in the interactiveLayer the click happened. It always works correctly if you zoom the map out sufficiently before clicking a region.
Screen.Recording.2024-10-21.at.7.28.30.AM.mp4
I've worked around the issue by using the polygon from the original geoJson I'm loading to set the bounding box but it would be nice not to have to do that additional lookup as I believe the correct data should exist inside the onMapClick event's data.
Expected Behavior
I'd expect the MapLayerMouseEvent.features to be the same every time when clicking into the same interactive layer.
Steps to Reproduce
Pull this repo, and run the "zoom-to-bounds" example, add a line inside the
onMapClick
event to console theevent.features[0].geometry.coordinates[0].flat()
and observe different values returned when clicking at different points within the same feature.Environment
Logs
No response
The text was updated successfully, but these errors were encountered: