Posted by BWPanda on October 1, 2009 at 5:30am
7 followers
Jump to:
| Project: | OpenLayers |
| Version: | 6.x-1.x-dev |
| Component: | Behaviors |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
When using the Grouping field, clustering doesn't work. Disabling the grouping field allows clustering to work again.
Also, how do you assign a custom image to the cluster feature? I want to give it a specific image, rather than the default orange circle...
Comments
#1
This is a bug in the clustering behavior, not the view. For anyone wishing to take on this bug, here is an example of it not working:
<?php
$preset = openlayers_get_preset('default');
$map = $preset['preset_data'];
$map['behaviors'] = array (
'clusterone' => array (
'id' => 'clusterone',
'type' => 'openlayers_behaviors_cluster',
'layer' => 'default_vector',
),
'clustertwo' => array (
'id' => 'clustertwo',
'type' => 'openlayers_behaviors_cluster',
'layer' => 'second_vector',
),
'fullscreen' => array (
'id' => 'fullscreen',
'type' => 'openlayers_behaviors_fullscreen',
),
);
$map['layers']['default_vector'] = array (
'id' => 'default_vector',
'type' => 'Vector',
'name' => t('Default Vector'),
'options' => array(),
'features' => array(
'yeah' => array(
'wkt' => 'POINT(-55 55)',
'projection' => '4326',
),
'yeah2' => array(
'wkt' => 'POINT(-50 50)',
'projection' => '4326',
),
),
);
$map['layers']['second_vector'] = array (
'id' => 'second_vector',
'type' => 'Vector',
'name' => t('second Vector'),
'options' => array(),
'features' => array(
'yeah3' => array(
'wkt' => 'POINT(55 -55)',
'projection' => '4326',
),
'yeah4' => array(
'wkt' => 'POINT(50 -50)',
'projection' => '4326',
),
),
);
$map = openlayers_render_map($map);
print $map['themed'];
?>
#2
updating version...
#3
crap. updated to wrong version... updating to correct version.
#4
http://drupal.org/cvs?commit=297066
I changed around the clustering logic pretty significantly. Before it was taking options from the behavior array and pushing them into the top level map options. Then it would create a cluster object for the vector layer based on those. I am not actually even sure if it was working.
Now, it is all based on layers (and should be only for Vector layers). So, a behavior is defined as a cluster with a layer defined. Then when Vector layers are made, they look for corresponding cluster behaviors.
This seems to be working fine with the test example I coded into the test module. But more testing would be great. Also, please note that this may break anyone currently using clustering.
As far as 2.x, I don't feel this is a very elegant solution, and I am not sure what is in the 2.x code as far as clusters, so I don't think there is any reason to port this.
#5
Automatically closed -- issue fixed for 2 weeks with no activity.
#6
I have a WMS map with three layers grouped by a cck field and if I turn on the clusterer for the view
my template overridden colours are lost and popups don't work anymore.
As soon as I disable cluster it works again.
This is fine as I don't need it but I just wanted to report it.
This happens even with the current dev version.
#7
Changing component back
#8
Actually I've resolved the popup issue I was having.
The colours thing is kind of a different issue to the one committed but the original poster also asked about it.
I can open a different issue for that if you like.
#9
@agileware, if you are still having a problem and it is unrelated to this specific issue, then it would be cool if you started a new ticket. Thanks.
#10
No worries
#11
i am not shure if this matches the issue, but i am trying to cluster multiple layers. so that points of different layers could be clustered together. it doesn't seem to work and i suppose this is yet by design. could this be confirmed?
#12
@dasjo clustering is per-layer by design. Doesn't match the issue.
#13
thanks strk, resetting this issue and opened a support request: #930864: clustering across multiple layers
#14