0
\$\begingroup\$

I'm using Canvas to create polygons like this:

http://bl.ocks.org/mbostock/6675193

I want each of those polygons to represent a clickable province. How do I know which province is clicked when the user clicks on something? I have a list of vertices (thousands) but I feel like each time looking for the closest vertex is too slow (I think I might be wrong). What's a fast way to do it? Thanks.

\$\endgroup\$
2

Browse other questions tagged .