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

select a polygon #91

Open
fgmorabito opened this issue Mar 8, 2024 · 2 comments
Open

select a polygon #91

fgmorabito opened this issue Mar 8, 2024 · 2 comments

Comments

@fgmorabito
Copy link

hi @vasturiano and thanks for this amazing library.

it's there a way to select a polygon among those drawn in the geojson? Let me explain: the globe rotates, randomly stops on a point of view, which is inside one of the polygons I have drawn. I would like to ensure that that polygon is already highlighted at the stop, without the user having to click this.

Thanks
Francesco

@vasturiano
Copy link
Owner

vasturiano commented Mar 8, 2024

@fgmorabito if you know the lat,lng coordinates of the location in the globe that you wish to find the polygon for (and then highlight it), you just need to cycle through the polygons in your GeoJSON and find the one that includes those particular coordinates.

If you need, d3-geo has a utility for that.

@fgmorabito
Copy link
Author

thanks @vasturiano . Yes, i have the coordinates.
there's some example for help me to build the cycle?

thanks
Francesco

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