gmap marker settings - assigning terms and displaying different markers based on these in a gmap view map
Toddv - January 3, 2008 - 15:09
| Project: | GMap Module |
| Version: | 6.x-1.1-rc1 |
| Component: | Miscellaneous |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Description
I have a gmap view working just fine - location-enabled events show up on the view with the icon that I set in the admin>gmap location. But I'd like to have different markers show up on the map based on terms. I have enabled the term for gmap markers and chosen gmap markers for the relevant terms but I still get the marker that is set in gmap location settings. There seems to be no way in the gmap locations settings to disable or override that. I played around with the View settings but none seem to make a difference. What am I missing?
thanks so much,
TV

#1
Subscribing, interesting..markers based on terms would be great!
greetings,
Martijn
#2
Uh, currently you have to resave the nodes before they will get the correct icon.
If there's demand for it, I can write something to convert everything all at once...
#3
Hi - thanks for the reply. Do you mean I have to, in the case of the my gmap view that consolidates my location enabled nodes into a map, simply open it, edit, and save? Gmap is awesome, btw.
Thanks
#4
I mean it won't pick up the change until you go to the individual nodes and re-save them. There is a seperate table where I'm maintaining node<->marker associations, but I don't go back and retroactively ....
Hmm, you know, I *could* make it update all the nodes upon saving the *term*... That might be more helpful than making people resave all the nodes...
One moment...
/me opens up his editor...
#5
Done.
I added another column to the gmap_taxonomy_node table, so you'll have to run an update.
The system will now automatically update things as needed when assigning markers to terms. (It previously only noticed when saving a node with a term previously assigned a marker.)
Additionally, the update will fix everything up so you don't have to go resave your terms.
#6
I forgot to add, "Changes committed to cvs. If you'd like to try it out right away, cvs up or grab the files from this attachment here."
#7
Awesome. I'll try and check it out a bit later. Thanks much!
TV
#8
Getting very close here -
My map/node page is working as your code suggests it would: different colored markers show up based on taxonomy -great. (and appreciated!)
However,
I have a view that is set to display markers from location enabled nodes and to be sorted by date. The markers on this page are appearing as the default that is set in gmap locations.
Put another way, I want the information on map/node to be sortable by date, perhaps by term as well, and with the markers displayed with marker-term color. I have tinkered with the view filters (and you are assisting me with another issue on this) and refreshed caches, but to no effect.
Thank you,
TV
#9
Ahh, are you using the latest gmap_views.module?
There were some changes to it I had to make to accomodate gmap_taxonomy...
Latest should have this on the second line of the file:
/* $Id: gmap_views.module,v 1.1.2.22 2007/12/30 16:21:45 bdragon Exp $ */
#10
Umm. My version was one behind. I grabbed the xxx2.22 out of cvs. - We're in biz - it works fine. Now I just need to figure out how to make a key for the symbols. Not a gmap issue...
Thanks much for your excellent support!
TV
#11
subscribing...
#12
Oh for those that don't know..., here is how to actually use it: (I used the latest Development snapshot of the gmap module),
- In the "GMap markers" section down at the bottom, tick "Enable" on and hit submit.
That's it! Hopefuly this will save time to other people as there seems to be no readme on this yet :)
Thanks a ton for this! it works as far as i can see it (on latest drupal 5), can't wait til it's released as stable -
Greetings from Barcelona!
#13
Following up on Manuee's instructions...
4. Also be sure to select "GMap Taxonomy: Marker" as one of the fields for your view. This was not obvious to me and was a bit of a head-scratcher.
It appears that the taxonomy markers don't do too well with free tagging and/or multiselect. Originally I was assigning markers to tags that were part of a free tagging vocabulary - none of the taxonomy markers were appearing. It was only when I modified the vocabulary to non-multiselect, non-free tagging that it started working.
I came across a DB error along the way, but I am now unable to reproduce it. I believe it was complaining about a duplicate key in the gmap_taxonomy_node table during a term update (admin/content/taxonomy/edit/term/)...
Regardless, this is a very cool addition to the GMap module. Thank you!
#14
Thanks for filling in the gaps there ultimike!
Indeed it is a very nice addition to the module, can't wait for it to be released as ready for production :D
#15
This is exactly what I needed (Thanks!), but I noticed some buggy behavior while configuring this. Once I selected a marker for a term, I was not able to deselect it -- I couldn't clear out the marker field. And even if I disabled the taxonomy markers for the whole vocabulary, the selected markers were still showing up on my map.
#16
Thanks for adding this feature -- it's great! I've got this working now in combination with voting actions, so the marker changes based on the average vote (a numeric taxonomy term is auto-assigned based on the ave. vote). My only issue now is that the marker does not automatically update when the Action update the taxonomy. So someone votes, and the taxonomy is automatically updated through the Actions and Voting Actions modules, but the marker does not update at the same time.
The marker only updates if I edit and then resubmit the node. I don't know if this should be addressed through gmap_taxonomy or through the Action, and I can't figure out how to automatically replicate the edit/submit function with the Action.
#17
subscribe + excellent -> should be a "real" module!
#18
@ultimike - i do not see *any* "gmap taxonomy: markers" field in views settings - am i missing something??? it's all working on the node level, shows my custom marker for taxonomy, but views is still holding onto content type...
EDIT: was this patch committed? it handles this precise issue: http://drupal.org/node/327053#comment-1107280
#19
in regards to the last comment, if you are on drupal 6, its labelled as "Node: Marker" or at least thats the best I found.
I have included this field in my view, but i am still getting the default markers. see attachment
#20
I am still getting the default marker, too. I could not get rid of it by 1)changing everything in this node type to a different marker in the Gmap Locations settings. Or 2) using Gmap Taxonomy as described here.
I did select Node:Marker in my view, and it is calling the different marker. I know because I did not hide Node:Marker. So it shows up in the info box that pops up when I click on the marker.
#21
Just wanted to emphasis this section from ultimike:
"It appears that the taxonomy markers don't do too well with free tagging and/or multiselect. Originally I was assigning markers to tags that were part of a free tagging vocabulary - none of the taxonomy markers were appearing. It was only when I modified the vocabulary to non-multiselect, non-free tagging that it started working."
I been going nuts for the last week trying to get my taxonomy markers working - make sure you haven't selected 'Tags' or 'Multi Select' in admin/content management/taxonomy/edit vocabulary
#22
I also have this problem. My tags are 'non-free tagging' but multi select. Markers do not show up as per the selected colours
#23
Thank you all, these comments helped me get this working. Here's my summary.
I am using Gmap module 6.x-1.x-dev (2009-Jun-08)
I have a vocabulary with terms that are single select, not free tagging or multi-select, and each term has a map marker selected.
1. In the map view I set the default view GMap style settings (the gear icon), Marker handling = By term (for node views)
2. Add Views Field, "Taxonomy: All terms". Exclude from display, Limit terms by vocabulary, selecting the desired vocabulary.
Any existing nodes must be re-saved for the marker changes to take effect. You will not see the changes until existing nodes are re-saved or new nodes are created. This could be a significant problem for some sites. I thought I saw a comment about this being a problem in the 5.x branch that was patched so that existing nodes did not need to be re-saved. Is there a 6.x patch for this?
Subsequent changes in selection of map marker for individual taxonomy terms takes effect immediately.
#24
Subscribing...
I also found that I had to re-save content for the changes to the markers to take place.
What I would love to see is a way to allow Multiple select, but use the parent term as the marker.
#25
THANK YOU! I couldn't find the settings and never though to look at my vocab and terms.
To note, if you already have nodes, you must resave each of them so they appear with your new markers.
#26
Thanks a lot for the info in this thread !
Struggled a long time to change markers at runtime, with Javascript.
This solution is way more elegant and easy to setup.
#27
One other key factor is that the view should be based on nodes. If it is based on locations, then that is when the taxonomy fields will not show up so that they can be chosen.
#28
I did everything written here but marker is still in one color.
I have a vocabulary with two terms and two different colors for markers.
The only difference I see is that I'm using Row style : Node... so in this case I can't add fields "Taxonomy: All terms" for this view.
I also tested with Row style: Fields, enabled Taxonomy : All terms, resaved content... but still only one type of markers???