react-simple-maps
react-simple-maps copied to clipboard
Retuned Position object from ZoomableGroup doesn't correspond to Center
I'm try to control the drag boundaries using onMoveStart and onMoveEnd but the position object it returns doesn't return anything to do with the last center value.
In fact, looking at the code, it seems to return the difference between the pointer's x/y start and end. https://github.com/zcreativelabs/react-simple-maps/blob/ce074907273605ad3be3a879d24b5fbea18630c1/src/components/useZoomPan.js#L55-L91
However, these values are almost useless when you're zoomed in any degree. Trying to determine the center based on the distance dragged from the mouse is crazy.
I'm also getting insane acceleration when dragging while zoomed in, which part of the reason why I'm trying to track these events.
I am also interested on this :)
With v2 this should now be possible. With translateExtent you should be able to limit the drag boundaries like with d3-zoom.