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

Restrict panning of a map beyond the boundary #324

Open
neel-tw opened this issue Apr 11, 2023 · 2 comments
Open

Restrict panning of a map beyond the boundary #324

neel-tw opened this issue Apr 11, 2023 · 2 comments

Comments

@neel-tw
Copy link

neel-tw commented Apr 11, 2023

I am trying to render the map of a specific country using the available GeoJSON file and wrapped it within a ZoomableGroup

The zoom and pan works fine, however the panning of the map cannot be restricted beyond a specific boundary. If the user accidentally moves the map outside the view area, then there is no way to restrict it.

image

I have tried the translateExtent prop and set a boundary but it does not seem to work. It works fine for the entire world map, but not for the country's map that I am trying to render

Is there anyway to calculate the bounds that are specific to a GeoJSON file and use that to set panning constraints ?

@Laurens256
Copy link

Hi did you have any luck with this? Currently experiencing the same issue

@csdiehl
Copy link

csdiehl commented Oct 5, 2023

Hey @zimrick I'm a dataviz developer and am interested in contributing to this library. I can try to tackle this issue, if no one else is already working this?

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

3 participants