dotskapes / wigglemaps

Dynamic, interactive maps for the web
Other
6 stars 1 forks source link

Change aggregate function callback #12

Open zack-krejci opened 12 years ago

zack-krejci commented 12 years ago

RIght now PolygonLayer.aggregate has a callback that takes a single point and a list of polygons that contain this point. This is wrong conceptually and bad for performance. Better would be to loop through each polygon and return a list of points contained in that polygon. Points would be in a LayerSelector, the polygon would not. The callback function signature should be function (Polygon, LayerSelector[Points]). Points may appear in multiple polygons by being pushed onto multiple lists by the PolygonLayer.