Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
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):
$markername = 'drupal';
To use the setting should be:
$markername = isset($this->options['markertype']) ? $this->options['markertype'] : 'drupal';
Attached patch.
Best
ema
Comment | File | Size | Author |
---|---|---|---|
#3 | gmap_plugin_style_gmap.inc_.patch | 1.99 KB | kanani |
gmap_plugin_style_gmap.inc_.patch | 481 bytes | EmanueleQuinto | |
Comments
Comment #1
BWPanda CreditAttribution: BWPanda commentedI noticed this problem too.
The above code works as expected (I didn't bother patching the file, just edited the code myself).
Thanks Emanuele!
Comment #2
teacherguy CreditAttribution: teacherguy commentedexcellent, thank you.
Comment #3
kanani CreditAttribution: kanani commentedFor 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.
Comment #4
zilla CreditAttribution: zilla commentedAHA~ @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)
Comment #5
bdragon CreditAttribution: bdragon commentedThe 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.
Comment #6
zilla CreditAttribution: zilla commented@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)?
Comment #7
bdragon CreditAttribution: bdragon commented6.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.
Comment #8
zilla CreditAttribution: zilla commentedthanks - 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...
Comment #9
zilla CreditAttribution: zilla commentedworks perfectly! thank you so much for putting that into head and dev so quickly!
Comment #10
francula CreditAttribution: francula commentedHi,
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
Comment #11
zilla CreditAttribution: zilla commentedyes - @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)
Comment #12
francula CreditAttribution: francula commentedHi 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
Comment #13
zilla CreditAttribution: zilla commentedunder 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?
Comment #14
francula CreditAttribution: francula commentedHi 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
Comment #15
zilla CreditAttribution: zilla commentedstrange - 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..
Comment #16
francula CreditAttribution: francula commentedHi,
still the same problem. Did I use the correct version? It is not the dev. It is the latest recommended version.
Regards Christian
Comment #17
zilla CreditAttribution: zilla commentednope, use the latest DEV version, it has the taxonomy marker fix in it from earlier this week...
Comment #18
francula CreditAttribution: francula commentedHi Zilla,
it works! Good new version!
Regards Christian
Comment #19
kanani CreditAttribution: kanani commentedHey 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
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.
Comment #20
tomywu CreditAttribution: tomywu commentedHi,
I just download the latest development version, but somehow ....I can't see the third option under Marker handling.
Did I miss sth?
Thanks
Comment #21
tomywu CreditAttribution: tomywu commentedProblem fixed when I try version 6.x-3.0
Comment #22
Summit CreditAttribution: Summit commentedBookmarking, greetings, Martijn
Comment #23
bdragon CreditAttribution: bdragon commentedMarking as fixed again.
Comment #24
josh@pixael.com CreditAttribution: josh@pixael.com commentedhi
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
Comment #25
josh@pixael.com CreditAttribution: josh@pixael.com commentedi fixed my problem... i used a location view :-) i changed to node view and all works correctly
Comment #26
dadderley CreditAttribution: dadderley commentedThanks for all the information. From following your discussion I managed to get this to work as well.
Comment #28
vthirteen CreditAttribution: vthirteen commentedwhen 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)
Comment #29
vthirteen CreditAttribution: vthirteen commentedin 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
Comment #30
ndm CreditAttribution: ndm commentednothing appropriate
Comment #31
ndm CreditAttribution: ndm commented