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.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | DrupalFID2.diff | 1.23 KB | strk |
| DrupalFID.patch | 818 bytes | strk |
Comments
Comment #1
zzolo commentedI can't tell where you are getting key from in the patch?
Comment #2
strk commented"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).
Comment #3
tmcw commentedstrk: 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.)
Comment #4
strk commenteddiff -up attached.
Comment #5
zzolo commentedCommitted:
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.
Comment #6
strk commented"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).
Comment #7
zzolo commentedWe should keep that discussion in the clustering issue.
Comment #8
strk commentedOk, for reference, the clustering issue is here: http://drupal.org/node/805264