The attached patch adds a 'drupalFID' member to each feature passed to OpenLayers.
This is needed to distinguish actual features (elments of the 'features' array passed
as second argument to Drupal.openlayers.addFeatures) after they are exploded into
components in the case of GEOMETRYCOLLECTION types.

The association will be useful to do things like avoiding duplicated informations in popup/tooltips
and properly count distinct features in case of clustering (for say, dynamic styling based on number of
actual features composing a cluster).

See also #805264 for some context.

Files: 
CommentFileSizeAuthor
#4 DrupalFID2.diff1.23 KBstrk
DrupalFID.patch818 bytesstrk

Comments

zzolo’s picture

I can't tell where you are getting key from in the patch?

strk’s picture

"I can't tell where you are getting key from in the patch?"

That's the index in the array of features passed as argument to the addFeatures() API method.
It's an arbitrary identifier, but is guaranteed to be unique for each _real_ feature (each member
of the array passed to the method).

tmcw’s picture

strk: can you format this patch as CVS diff -up? It's hard testing patches quickly when they don't apply automatically. (otherwise this patch looks solid and the fid approach makes sense now that it's explained fully.)

strk’s picture

StatusFileSize
new1.23 KB

diff -up attached.

zzolo’s picture

Status:Active» Fixed

Committed:
http://drupal.org/cvs?commit=384892

About the duplication of adding attributes to features, I did a small search to see if it was used anywhere, but off the top of my head, I am not sure why this is duplicated. Maybe for another issue.

strk’s picture

"About the duplication of adding attributes to features, I did a small search to see if it was used anywhere, but off the top of my head, I am not sure why this is duplicated. Maybe for another issue."

Duplicates I'm talking about are in the clustering case. Not an issue with current head, but will be when
adding "clustering" knowledge to popup/tooltip. Yes, better to discuss about this in a separate ticket.
The patch is currently in http://drupal.org/node/805264 but I can file a separate ticket for that, unless there's
already one specific for popup/tooltip reorganization (please let me know).

zzolo’s picture

We should keep that discussion in the clustering issue.

strk’s picture

Ok, for reference, the clustering issue is here: http://drupal.org/node/805264

Status:Fixed» Closed (fixed)

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