osmdroid trying to display many polygons overlay

i need to overlay many ( clickable ) polygons on the map (over 5000), so the normal Polygon overlay is slow in performance.

My idea is to create a custom bitmap overlay, drawing on a bitmap canvas only polygons that are inside current bounding coordinates, ignoring all drawing for polygons outside.

Moreover i would to redraw the overlay only when the user has finished to zoom or panning, not during this operation, for performance reasons.

Can someone please point some help to me?

Thanks.


In your case, Bounding box test is a good solution when a lot of polygons are completely outside the viewbox.

You can subclass the Polygon, add a bounding box attribute, and override the draw method to first test if this bounding box is completely outside the viewbox.

No need to draw on a bitmap canvas.

Now, if the user zoom-out, he will have all polygons inside the viewbox: back to the initial issue... A solution could be to handle levels of details. Maybe using the DouglasPeucker reducer (available in OSMBonusPack utils).

链接地址: http://www.djcxy.com/p/68576.html

上一篇: 如何知道小数中的重复小数?

下一篇: osmdroid试图显示许多多边形覆盖