Support from Acquia helps fund testing for Drupal Acquia logo

Comments

DjebbZ’s picture

Status: Active » Postponed

The OpenLayers style plugin from D6 version needs to be updated to D7 first before this can work. The Drupal and Views sides are properly sending the data to the javascript side. (confirmed with zzolo, here at London DrupalCon).

zzolo’s picture

Title: Undefined Label in Clustered Data Points » Undefined Label in Clustered Data Points (Port Style Plugins)
Status: Postponed » Active

There is currently a branch for porting the Style Plugins. A bigger feat than I expected:

http://drupal.org/node/177400/git-instructions/feature-port-style-plugins

ekes’s picture

Status: Active » Fixed

Clustering features have been fixed in present version. Attribute is set in present version - unless I misunderstand the issue, re-open if so.

Pol’s picture

@zzolo: Can we delete that branch ?

zzolo’s picture

Yep, go for it.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Exploratus’s picture

Status: Closed (fixed) » Active

When I activate clusters, my defined attribute for a style renders "undefined". When I turn off clustering, my attribute renders fine. I guess this is still an issue? Basically, I cannot have a custom defined field as an attribute if I want to have clustering enabled.

japo32’s picture

FileSize
33.35 KB

I'm using Drupal 7.22, Openlayers 7.x-2.x-dev. The same thing is happening in my site - when I turn off the "Cluster Features" behavior, the attributes render fine. when I turn it on, all the attributes are undefined.

Also, the undefined label renders twice - one as a label, and another as an outline, one on top of the other. So the result is a thick rendering of the letters.

Here's the rendered HTML for the label.

<text id="OpenLayers.Feature.Vector_435_label" x="504.1111261233673" y="267.64326337669263" fill="white" stroke="white" stroke-width="3" font-size="10" font-weight="normal" pointer-events="none" text-anchor="middle"><tspan id="OpenLayers.Feature.Vector_435_label_tspan_0" baseline-shift="-35%" x="504.1111261233673" dy="0em">undefined</tspan></text>
<text id="OpenLayers.Feature.Vector_435_outline" x="504.1111261233673" y="267.64326337669263" fill="#FFFFFF" font-size="10" font-weight="normal" pointer-events="none" text-anchor="middle"><tspan id="OpenLayers.Feature.Vector_435_outline_tspan_0" baseline-shift="-35%" x="504.1111261233673" dy="0em">undefined</tspan></text>

I've attached a screenshot.
feature
Please take note that I made an undefined.png (sun icon) so it doesn't look all broken. :)

Metasequoia’s picture

I'm using Drupal 7.22, Openlayers 7.x-2.x-dev. The same thing is happening in my site - when I turn off the "Cluster Features" behavior, the attributes render fine. when I turn it on, all the attributes are undefined.

I experience exact the same problem. This is obviously a bug.

japo32’s picture

Hi guys, I think I may have fixed this bug. Plus I've added a new feature where you can set the clusters to show the top priority feature instead of the default circles with numbers. But you need to create a new field for your view for the sorting order.

I also fixed the popup to accommodate the new top priority feature.

Please review. :)

Fix

Metasequoia’s picture

wow, looks good! currently I have no time to review the patch and I am furthermore a total newby to patching modules. but I will definitely try it next week and give you feedback.

Exploratus’s picture

Big patch! I'll do some testing and report back.

japo32’s picture

I'm a newbie as well. This is my first patch submitted. And I have to say, seeing that it passed the simpletest makes me really happy hehe. :)

Pol’s picture

Status: Needs review » Needs work

Hello there,

Sorry for the lack of presence these days, I'm in holidays, so, I take it easy :)
Here's a quick review for your patch...

+++ b/plugins/behaviors/openlayers_behavior_cluster.jsundefined
@@ -15,9 +16,18 @@ Drupal.openlayers.addBehavior('openlayers_behavior_cluster', function (data, opt
+  console.log(map);

Remove console.log().

+++ b/plugins/behaviors/openlayers_behavior_cluster.jsundefined
@@ -15,9 +16,18 @@ Drupal.openlayers.addBehavior('openlayers_behavior_cluster', function (data, opt
+  jQuery(layers).each(function(index, layer){  ¶

Remove trailing spaces.

+++ b/plugins/behaviors/openlayers_behavior_cluster.jsundefined
@@ -25,131 +35,294 @@ Drupal.openlayers.addBehavior('openlayers_behavior_cluster', function (data, opt
+      ¶

Remove trailing spaces.

japo32’s picture

I cleaned all the console.log() and trailing/unnecessary spaces.

Pol’s picture

Thanks for your speed !
But sorry to be picky, but there are still some trailing spaces left all over the patch...
Here some examples...

+++ b/plugins/behaviors/openlayers_behavior_cluster.jsundefined
@@ -16,6 +17,14 @@ Drupal.openlayers.addBehavior('openlayers_behavior_cluster', function (data, opt
+    jQuery( layers ).each( function( index, layer ){ ¶

Here

+++ b/plugins/behaviors/openlayers_behavior_cluster.jsundefined
@@ -25,127 +34,284 @@ Drupal.openlayers.addBehavior('openlayers_behavior_cluster', function (data, opt
+      ¶

Here

+++ b/plugins/behaviors/openlayers_behavior_cluster.jsundefined
@@ -25,127 +34,284 @@ Drupal.openlayers.addBehavior('openlayers_behavior_cluster', function (data, opt
+  if( options.display_cluster_numbers === 'numbered' || ¶

Here

+++ b/plugins/behaviors/openlayers_behavior_cluster.jsundefined
@@ -25,127 +34,284 @@ Drupal.openlayers.addBehavior('openlayers_behavior_cluster', function (data, opt
+          if( feature.cluster[selected_feature_num].data[sorter] > ¶

Here

japo32’s picture

It's ok Pol. Is there a way to check for the EOL spaces automatically? like a cleanup plugin? I'm using sublime2 to edit.

Pol’s picture

I don't use Sublime, I use PHPStorm which remove them automatically. Maybe there's an option in Sublime ?

japo32’s picture

I used the JS Format plugin in Sublime. :) Pls check if that did the trick.

jetsonjohn’s picture

Cluster number is not displaying when I use this patch

jetsonjohn’s picture

Cluster number is displayed whwn I changed the sites/all/modules/openlayers/plugins/behaviors/openlayers_behavior_cluster.js at line 45 a little bit

if (options.display_cluster_numbers === 'numbered') {

to

if (options.display_cluster_numbers === 'clusters'){

now the count is showing in the cluster marker in the map.

japo32’s picture

jetsonjohn,

The patch adds 3 options to the display as illustrated in comment 10. You can check the behavior settings of your layer.

What you did in comment 21 was change the settings manually. :) the behavior setting "Cluster Variant" in the Clusters section does the same thing. :)

pmusaraj’s picture

I created a simplified patch from the above, and my patch only fixes the "undefined" graphic issue when using clustering. Let me know if this works.

chaloalvarezj’s picture

I had the problem of ${attributes} not been applied in styles when clustering was enabled.
The patch in #23 seems to have solved it. So far my attributes are been passed!
Thank you!

citkane’s picture

Thanks japo32 and pmusaraj, patch @ #23 worked for me. Does anybody know if this will be included in main Openlayers module release?

skyredwang’s picture

Status: Needs work » Needs review
SidneyGijzen’s picture

Confirming that the patch from #23 works with OpenLayers 7.x-2.0-beta11. Thanks japo32 and pmusaraj!

basvredeling’s picture

Cleaning up the issue queue for #2670484: Stable 7.x-2.0 release.
This needs to be evaluated for inclusion in 7.x-2.0 stable