I'm not sure if this is a bug or should work in a different way.

On the view settings for gmap (gmap_plugin_style_gmap.inc) you can select "Marker type to use" (after "Use single marker type"). But on the output is used the "drupal" one (line 53):

<?php
$markername
= 'drupal';
?>

To use the setting should be:

<?php
$markername
= isset($this->options['markertype']) ? $this->options['markertype'] : 'drupal';
?>

Attached patch.

Best

ema

Comments

Status:Active» Reviewed & tested by the community

I noticed this problem too.

The above code works as expected (I didn't bother patching the file, just edited the code myself).
Thanks Emanuele!

excellent, thank you.

StatusFileSize
new1.99 KB

For me this didn't help with taxonomy based markers in views. Attached patch allows you to select "By taxonomy term (for node views)" under "Marker Handling", then sets the marker based on the taxonomy.

AHA~ @kanani - you have fixed my problem! this is *exactly* what i'm having trouble with: http://drupal.org/node/338243

is this patch in head yet? i do not know how to apply patches but was wondering for hours why i didn't see 'by taxonomy term' to override the content type preset inherited from gmap location!

please advise -i'm desperately trying to get this into the main map view (taxonomy is just fine in node and block level with custom icons)

Version:6.x-1.0-rc2» 6.x-1.x-dev
Status:Reviewed & tested by the community» Fixed

The taxonomy markers should now be working in HEAD.

I used a much more performant solution than the patch in #3 -- I add the marker field from gmap_taxonomy_node in query() and simply read the answer back out in render().

http://drupal.org/cvs?commit=154904

Also, I went and fixed the defaults as suggested in the OP, with some additions.

http://drupal.org/cvs?commit=154906

This should now be fixed.

@bdragon - thank you! will this also roll into dev over the coming days?

in the interim, if i don't want to use head, could i simply replace the file: gmap_plugin_style_gmap.inc with the one from the cvs (meaning drop it right into the 6x version i have running)?

6.x-1.x-dev is a twice-daily snapshot of HEAD. It will show up automatically in a few hours.

The change in question is also dependent on the new file gmap_taxonomy.views.inc, and changes in gmap_taxonomy.module. All three of these files should be able to just be dropped in from HEAD into anything RC1 or newer.

thanks - i'll just pull down head shortly...also pulling together some custom icons so may post back up here as a minor contrib in case people want to use 'em...

works perfectly! thank you so much for putting that into head and dev so quickly!

Title:gmap view default markermarker type assigned to a term is not displayed
Version:6.x-1.x-dev» 6.x-1.0-rc2
Status:Fixed» Postponed (maintainer needs more info)

Hi,
this work very well for me. Now I have the markers type which is assigned to the node type. But what I'm acutally looking for is that markers on the map have the marker types which i assigned to a term.
Regards Christian

yes - @francula, this IS working - you need to go into views and to the right of gmap (as style) is a little machine icon, click it and change to 'taxonomy' from 'node' (or whatever else is selected)

Hi Zilla,
thanks for your fast answer but i can not find the 'taxonomy' option.
i have the following options:

Data Source:
X Location.module
O Fields named "latitude" and "longitude" @@@TODO

Marker handling:
O By content type (for node views)
X Use single marker type

The X are the optioins I chose.

Regards

under marker handling (@francula) you should now be seeing a third option - are you using the latest dev version of this module? have you assigned at least one icon to a taxonomy term to test this (under taxonomy/edit terms)? have you enabled gmap taxonomy markers module in admin/modules?

Hi Zilla,
- I'm using the gmap-6.x-1.0-rc2 version.
- I have asigne an icon to a term
- I have enabled the gmap taxonomy markers module in admin/modules
Thanks for your fast answers.
Christian

strange - you may need to either revert the view, or simply create a new view (don't even bother saving it) and see if the option exists..

Hi,
still the same problem. Did I use the correct version? It is not the dev. It is the latest recommended version.
Regards Christian

nope, use the latest DEV version, it has the taxonomy marker fix in it from earlier this week...

Hi Zilla,
it works! Good new version!
Regards Christian

Hey bdragon,

Thanks for cleaning up my code. (#3) There is a difference in functionality however.

Because DEV uses gmap_node_marker (which does not seem to get updated for each row when a node has multiple taxonomy terms) DEV places identical vertically stacked markers on the map (so that you only see one marker that represents the first term returned).

The patch in #3 uses term_data_tid (which does get updated for each term), allowing a single node to have multiple taxonomy markers, enabling complex graphical representation of nodes on a map.

In the case where a term has not been associated with a marker, the default marker is being used, which is generally not desired behavior. Adding a null check around

          /*
           Only add markers if they correspond to taxonomy term.
          */
          if($markername != null){
            $markers[] = array(
              'latitude' => $lat,
              'longitude' => $lon,
              'markername' => $markername,
              'offset' => $offsets[$markername],
              'text' => $this->row_plugin->render($row),
            );
          }

fixes this.

In my scenario I have architectural case studies on a map, each case study is being tagged with a term from the "Industry" vocabulary, the "Category" vocabulary, and as well as the case studies authors("Author" vocabulary), which are also taxonomy terms. For the map we are only using "Category" and "Industry" to represent the node, and we don't have author markers set. Using multiple markers allows complex representation of the nodes, without having to create a single marker for each Category/Industry combo.

Hi,

I just download the latest development version, but somehow ....I can't see the third option under Marker handling.
Did I miss sth?

Thanks

Problem fixed when I try version 6.x-3.0

Bookmarking, greetings, Martijn

Version:6.x-1.0-rc2» 6.x-1.0
Status:Postponed (maintainer needs more info)» Fixed

Marking as fixed again.

hi
i installed gmap 6.x-1.x-dev but when i choose marker handling "by term" in views style i receive this errors:
* warning: Invalid argument supplied for foreach() in /var/www/web22/web/modules/gmap/gmap_plugin_style_gmap.inc on line 159.
* user warning: Unknown column 'gmap_taxonomy_node.marker' in 'field list' query: SELECT location.lid AS lid, node.title AS node_title, node.nid AS node_nid, location.latitude AS gmap_lat, location.longitude AS gmap_lon, gmap_taxonomy_node.marker AS gmap_node_marker FROM location location LEFT JOIN location_instance location_instance ON location.lid = location_instance.lid LEFT JOIN node node ON location_instance.vid = node.vid LIMIT 0, 100 in /var/www/web22/web/modules/views/includes/view.inc on line 725.

the query seems to ignore gmap_taxonomy_node in join

i fixed my problem... i used a location view :-) i changed to node view and all works correctly

Thanks for all the information. From following your discussion I managed to get this to work as well.

Status:Fixed» Closed (fixed)

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

Version:6.x-1.0» 6.x-1.x-dev
Status:Closed (fixed)» Active

when i set Marker handling as By Term in views > style > gmap settings i get this error, both in 6.x-1.1 and upgrading to 6.x-1.x-dev

Unknown column 'gmap_taxonomy_node.marker'

and the map is not created.

it sounds like the table has not been updated after I enabled the GMap Taxonomy Markers module (but it is checked on the modules page)

Status:Active» Closed (fixed)

in a fresh installation with the same modules and same versions installed from scratch i could not replicate this error, so i suppose the previous error was generated by some misconfiguration in my previous install.

closing

Status:Closed (fixed)» Active

nothing appropriate

Status:Active» Closed (fixed)