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

Programmatically zoom to Area #430

Open
Rkallenkoot opened this issue Aug 15, 2024 · 2 comments
Open

Programmatically zoom to Area #430

Rkallenkoot opened this issue Aug 15, 2024 · 2 comments

Comments

@Rkallenkoot
Copy link

Currently trying to figure out a way to Zoom to an Area programmatically and running into some issues. It seems that Unovis is dealing with all the different layers, TopoJSON / GeoJSON and d3 in the background, but I cannot figure out a way to do this.

Is there a chance we can add this feature in the TopoMap component?

An example would be to click on a country/area and zoom + center the map to this. Is this currently possible?

@rokotyan
Copy link
Contributor

@Rkallenkoot Zooming to a specific area is not yet supported by TopoJSONMap, although I agree that it would be a nice feature to have. At the same time, I'm not sure how useful it will be, since TopoJSON maps are schematic and typically don't provide detailed views. Can you tell us more about the problem you're trying to solve with this feature?

@Rkallenkoot
Copy link
Author

Thanks for the response!
My current use-case is to display a statistic per Area. Some countries / islands (example: Caribbean islands) are so small that you can't see them unless zoomed in quite a bit.
I'm displaying the exact stats in a table next to the Map, the user can click on the "Country" and I'd like to center the map around this Country with some additional Zoom. It would also be nice to be able to programmatically reset the center and zoom.

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

2 participants