shuding / cobe

5kB WebGL globe lib.
https://cobe.vercel.app
MIT License
3.15k stars 169 forks source link

Marker onClick or onHover event? #49

Closed ronalddas closed 1 year ago

ronalddas commented 1 year ago

Hi, is there any way to know when a marker was clicked or hovered over? I want to display a custom tooltip when a marker is clicked, wondering if this is possible with cobe

shuding commented 1 year ago

Sorry, but I don't think that will be possible without significant changes to the project design.

ZachSaucier commented 1 year ago

One thought about a work around: Use .getImageData() to detect a color similar to the marker, assuming they're a different color than the rest of the globe. Note that using this isn't very performant so it's probably best not to do every pointermove event or something like that.