On Thu, Oct 7, 2010 at 9:15 AM, Eric Lemoine <eric.lemo...@camptocamp.com> wrote: > On Thu, Oct 7, 2010 at 9:14 AM, Eric Lemoine > <eric.lemo...@camptocamp.com> wrote: >> On Wed, Oct 6, 2010 at 2:11 PM, Marc Jansen <jan...@terrestris.de> wrote: >>> Hi Eric, >>> >>> thanks for your feedback. >>> >>> Attached is an example that shows the usage and the benefits from the custom >>> classes. I would be happy if this could be included in the OpenLayers >>> examples. >> >> >> This is really nice! >> >> I modified your example a bit to make the extended classes rely on >> their parents' shouldCluster method, this is to avoid code >> duplication. I also renamed the files from cluster-strategy-extend.* >> to strategy-cluster-extended.*, to be consistent with the other >> cluster examples. >> >> Tell me if these changes are fine by you. >> >> Thank you Marc. > > The files are attached.
Argh I'm sorry, the .js file didn't get attached. Retrying. Hope this is fine this time. -- Eric Lemoine Camptocamp France SAS Savoie Technolac, BP 352 73377 Le Bourget du Lac, Cedex Tel : 00 33 4 79 44 44 96 Mail : eric.lemo...@camptocamp.com http://www.camptocamp.comTitle: Extended clustering example
Extended clustering
Shows the usage of custom classes for a fine grained control about the clustering behaviour.
Select the desired clustering strategy:
The vectorlayer in this example contains random data with an attribute "clazz" that can take the values 1, 2, 3 and 4. The features with clazz = 4 are considered more important than the others.
The radiobuttons on the right of the map control the cluster strategy to be applied to the features.
- No strategy means that all features are rendered, no clustering shall be applied
- Simple cluster-strategy applies the cluster strategy with default options to the layer. You should notice that many of the important features with clazz = 4 are getting lost, since clustering happens regardless of feature attributes
- Attributive cluster-strategy uses a customized cluster strategy. This strategy is configured to cluster features of the same clazz only. You should be able to see all red points (clazz = 4) even though the data is clustered. A cluster now contains only features of the same clazz.
- Rulebased cluster-strategy uses another customized cluster strategy. This strategy is configured to cluster features that follow a certain rule only. In this case only features with a clazz different from 4 are considered as candidates for clustering. That means that usually you have fewer clusters on the map, yet all with clazz = 4 are easily distinguishable
Hover over the features to get a short infomation about the feature or cluster of features.
View the strategy-cluster-extended.js source to see how this is done.
strategy-cluster-extended.js
Description: JavaScript source
_______________________________________________ Dev mailing list d...@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/openlayers-dev