I have a content type called organisations and one called locations. Each organisation have have multiple locations, and they are related by a node reference field. Each organisation has a taxonomy associated, with marker colours set, and I have a few that displays my locations and the organisations in a list with a gmap. However it wont pick up my my marker colours. How can i get it to pick up on the marker colours from the taxonomy of the related content ?

Comments

exobuzz’s picture

Just to note that I have selected "marker handling" "by term" under "Style options". However the taxonomy is in a related node rather than the node with the location information, so I assume this is the problem, and I need to do something for this to work ?

exobuzz’s picture

Category: support » bug

Looking at the SQL it joins against the current list of nodes, rather than the related nodes I want it to

LEFT JOIN gmap_taxonomy_node gmap_taxonomy_node ON node.vid = gmap_taxonomy_node.vid

Seems like a bug? Would it not be more sueful if it used a "term" field you add, as then you can choose the relationship of that field. in my case I want the marker colour to come from an organic group.

exobuzz’s picture

im assuming i need to change this code from gmap_taxonomy.views.inc to join against the organic groups table (as a temporary workaround).

any ideas?

function gmap_taxonomy_views_data() {
  $data['gmap_taxonomy_node']['table']['group'] = t('Node');
  $data['gmap_taxonomy_node']['table']['join'] = array(
    'node' => array(
      'left_field' => 'vid',
      'field' => 'vid',
    ),
    // @@@ Node_revisions?
  );
nemchenk’s picture

Subscribing -- I'm just looking at the SQL as well... I don't want OG-dictated markers, though, just one based on taxonomy on the related node.

nemchenk’s picture

I've just managed to hack my way around this by modifying the SQL using views_pre_execute() -- the problem is that, as exobuzz points out, the view is joining the gmap_taxonomy_node table to the *node* table, not the related node table (in my case, that's "node" vs "node_node_data_field_item_id")

There are useability issues here, though -- how will Views/Gmap know *which* taxonomy to join to? Some kind of drop-down selectors are probably needed, sort of like the lat/long is handled for related nodes...

johnv’s picture

Status: Active » Closed (won't fix)

Closing this very old issue. Please reopen if it is still valid.