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

Trigger polygon hover event for one of the polygons programmatically #190

Open
snadir7 opened this issue Feb 12, 2024 · 2 comments
Open

Comments

@snadir7
Copy link

snadir7 commented Feb 12, 2024

Hello, first thank you very much for this awesome project !
I am trying to trigger the polygon hover using javascript programmatically for a precise polygon (maybe using it's latitude and longitude for example). I tried looking for a way to do so but couldn't figure it out. What I am trying to do with this is highlight to the user the position of the country related to the flag he just clicked on.
Thanks !

@vasturiano
Copy link
Owner

@snadir7 if you know the polygon/country you wish to highlight you shouldn't need to trigger any hover functionality. Just invoke the style method you wish to change, for instance:

.polygonCapColor(d => d === highlightD  ? 'red' : 'blue')

@snadir7
Copy link
Author

snadir7 commented Feb 13, 2024

Thank you ! Indeed I managed to use .polygonAltitude and .polygonCapColor for my use case !

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