[OpenLayers-Users] Grouping Features into "one" feature using Styles or other means

Jonathan Sawyer jon at gina.alaska.edu
Thu Oct 8 14:10:41 EDT 2009


Well, my client requests that my application be able to turn off the
clustering feature (not the OpenLayers clustering, but the logical concept
of it, anyway), and to turn it back on again. Consider a very dense GPS
tracking system for someone in a car or on foot. If you log the coordinates
every second, it starts adding up fast and in about an hour you're pushing
4000 points. Clustering helps the rendering so the application can retain
some performance by drawing 50 points rather than 4000 points. Secondly, its
hard to see any kind of trend or path that the target took with clustering
on because the real points are obfuscated by bigger points that represent
more than one of those points.

So this is what I ended up doing. To "turn off" clustering, I just have my
application edit the threshold of the cluster to something insane like 1000,
then perform map.zoomIn(); then map.zoomOut(). I do this in succession
because, as you say, zooming in will redraw the clustering. And since the
user didn't request a zoom, we zoom back out.

On Wed, Oct 7, 2009 at 3:38 AM, Christopher Schmidt <crschmidt at metacarta.com
> wrote:

> On Tue, Oct 06, 2009 at 04:27:21PM -0800, Jonathan Sawyer wrote:
> > Christopher et al,
> >
> > Clustering works for me :) However, is there a way to turn off clustering
> > dynamically? I.e., call a function to deactivate it, zoom in or out
> without
> > clustering, then turn it back on, all without having to drop and reload
> > layers?
>
> Not really. SOme people have done it though, I believe. Though I'm not sure
> why you'd want to deactivate-zoom-reactivate? That doesn't make sense to
> me,
> since on zoom, the clusters will recalculate...
>
> -- Chris
>
> > Thanks again in advance!
> >
> > Jon
> >
> > On Mon, Oct 5, 2009 at 10:27 PM, Christopher Schmidt <
> > crschmidt at metacarta.com> wrote:
> >
> > > On Mon, Oct 05, 2009 at 04:07:27PM -0800, Jonathan Sawyer wrote:
> > > > Hi everyone,
> > > >
> > > > I have a feature class of points that displays a breadcrumb trail of
> GPS
> > > > points for a target. When zoomed out to the full extent of the map,
> > > > OpenLayers renders 1000+ points in a tiny little area, thus reducing
> > > > performance of my application. Is there a way I can tell OpenLayers
> to
> > > > render just one point for a bunch of points within a given radius of
> the
> > > > point? For example, when zoomed out to the full extent, I would
> rather
> > > have
> > > > 1 to 3 points rendered rather than 1000+, but then be able to see
> every
> > > > point applicable when zoomed in.
> > >
> > > Clustering.
> > >
> > > http://openlayers.org/dev/examples/strategy-cluster.html
> > >
> > > > Thanks in advance for any help.
> > > >
> > > > Jon
> > >
> > > > _______________________________________________
> > > > Users mailing list
> > > > Users at openlayers.org
> > > > http://openlayers.org/mailman/listinfo/users
> > >
> > >
> >
> >
> > --
> > Jonathan Sawyer
> > Geographic Information Network of Alaska (GINA)
> > University of Alaska Fairbanks
>
> --
> Christopher Schmidt
> MetaCarta
>



-- 
Jonathan Sawyer
Geographic Information Network of Alaska (GINA)
University of Alaska Fairbanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20091008/41eb1ba2/attachment.html


More information about the Users mailing list