[OpenLayers-Users] Re: How to manage huge amount of vector features

Adam Eskreis aeskreis at gmail.com
Mon Nov 28 13:32:48 EST 2011


I think you're crazy if you're trying to load 11000 records into javascript
memory, and even crazier if you're trying to put 11000 OpenLayers vectors
into the DOM at once.  Instead of pulling everything in at once, try only
hitting the backend when the user stops moving the map (i.e. the "moveend"
event).  Then just pass the map's current extents to the backend and
retrieve only the features on the screen.

OpenLayers isn't hte problem here it's the browser.  You can't have 5000
SVG elements on the screen and expect your browser to perform well.  I
would suggest keeping the number of features in the DOM at any given time
under 300.

-Adam

On Mon, Nov 28, 2011 at 6:16 AM, canduc17 <candini at meeo.it> wrote:

> Thank you for your response.
> It's ok, but if the user chooses an extent which involves 5000 elements, my
> page loads them all and navigation it's really tricky.
> Is there a way to merge small vector features into bigger ones, in order to
> decrease the number of objects loaded? Although something like that should
> be made at a PostGis query level, I guess...
> Any other hints?
>
> --
> View this message in context:
> http://osgeo-org.1803224.n2.nabble.com/How-to-manage-huge-amount-of-vector-features-tp7038117p7038371.html
> Sent from the OpenLayers Users mailing list archive at Nabble.com.
> _______________________________________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20111128/77595ccb/attachment.html


More information about the Users mailing list