dotskapes / wigglemaps

Dynamic, interactive maps for the web

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Change aggregate function callback

zack-krejci opened this issue · comments

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.