Thursday, November 22, 2007

10000 Markers

Been wanting to blog about this for a while. Users been asking me "how to I plot thousands of markers without the overhead of a Marker (which is a subclass of UIComponent) but still get the benefits of Marker mostly for mouse over/out/click events ?". Back in the days when I was RAT (Rent-a-Tech), my friend Leo came up with a concept of TurboLayer for SDE, where you group in one feature all the geometries of a feature class. It was fast, but you could not get to an individual feature because it was all "blob'ed" together (SDE folks out there, you know what I mean :-) So I took the same concept and implemented it in AWX, but with an extra twist where you can get to an individual feature indirectly using an RTree class. An RTree enables you to efficiently index features spatially on the client side. cool, eh ? You can download this zip file that contains an application that loads 1000 random points and when you mouse over a point, a tooltip shows up with the id of the point. If there are more that one point at that mouse location, then the tooltip text is a list of ids separated by '/'. I've tried this on 10000 point and did not notice a performance issue - this is due to the efficient implementation of the RTree (thanks Kerry :-). So...download the file and try it out and tell me what you think. Happy Thanksgiving.

No comments: