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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Summit’s picture

Subscribing, interesting..markers based on terms would be great!
greetings,
Martijn

bdragon’s picture

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...

Toddv’s picture

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

bdragon’s picture

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...

bdragon’s picture

FileSize
2.45 KB

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.

bdragon’s picture

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."

Toddv’s picture

Awesome. I'll try and check it out a bit later. Thanks much!
TV

Toddv’s picture

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

bdragon’s picture

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 $ */

Toddv’s picture

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

Manuel Garcia’s picture

subscribing...

Manuel Garcia’s picture

Version: 6.x-1.x-dev » 5.x-1.x-dev

Oh for those that don't know..., here is how to actually use it: (I used the latest Development snapshot of the gmap module),

  1. Enable "GMap Taxonomy Markers" in admin/build/modules
  2. Enter the category you want to have different markers in /admin/content/taxonomy/edit/vocabulary/[#of your category]
    - In the "GMap markers" section down at the bottom, tick "Enable" on and hit submit.
  3. Edit the term in that vocabulary, and specify what marker you want for that term in /admin/content/taxonomy/edit/term/[#of your term] (at the bottom again). Do that for each term you want to switch markers for.

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!

ultimike’s picture

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!

Manuel Garcia’s picture

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

crandell’s picture

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.

crandell’s picture

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.

momper’s picture

subscribe + excellent -> should be a "real" module!

zilla’s picture

@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

cangeceiro’s picture

FileSize
88.07 KB

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

halver’s picture

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.

pshipley’s picture

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

sharadaprasad’s picture

Version: 5.x-1.x-dev » 6.x-1.1-rc1

I also have this problem. My tags are 'non-free tagging' but multi select. Markers do not show up as per the selected colours

izmeez’s picture

Version: 6.x-1.1-rc1 » 6.x-1.x-dev

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.

ryantollefson’s picture

Version: 5.x-1.x-dev » 6.x-1.1-rc1
Component: User interface » Miscellaneous
Category: support » feature

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.

miche’s picture

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.

Countzero’s picture

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.

bkudrle’s picture

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.

alesr’s picture

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???

ressa’s picture

Thank you guys, comments #12 and #23 got me on the right track, Drupal 6.

1timer’s picture

sub

kirdydy’s picture

Thank You..#12 & #23 helped me

kirdydy’s picture

Now I have different marker colors for each map. Now I need multiple color markers in the same map. can anyone please suggest steps to include this...?

Thanks in advance

kirdydy’s picture

Priority: Normal » Critical
msathesh’s picture

in the end, @izmeez solution worked for me.. thanks guys..

cjs@rabash’s picture

FileSize
1.23 KB

There seems to be a bug in gmap_taxonomy module where the keys from $node->taxonomy, which are tids, are compared to the vids in gmap_taxonomy_vocabs. Attached is a patch which solves the problem but which might need some more work...

asiby’s picture

cjs@rabash, your patch seems to make sense when it comes to comparing the keys in $node->taxonomy with the right thing. However, it removes a completly unrelated but important feature which is the ability to deal with nodes with multiples taxonomies.

My question is ... Why?

I know that it might sound illogical to have two markers for the same point. However, this can be extended to assign a marker to a combination of markers.

Cheers

Liam_Mc’s picture

I'm having a related problem on a Drupal 7.8, GMap 7.x-1.x-dev, Location 7.x-3.x-dev site.

I'd like to show a view of a certain content type with different colored markers depending on the taxonomy term, as above.

So, I've enable GMap Taxonomy Markers and assigned a different marker to each of the relevant taxonomy terms. In the view I've chosen gmap with the data source as location.module and the marker handling by term (for node views). I've also rewritten the output of the fields so that in the pop-up bubble most the node content is shown. But I am having 2 problems.

Firstly, the markers are all the same.

And secondly, only the content:taxonomy field is being rewritten - all the other bubbles show the same content except for the taxonomy field.

Here is the page: http://www.sustainablebrampton.org/waw-map

Any help or advice would be great. I had it working perfectly in the same Drupal 6 site before it was upgraded.

Many thanks for a great module and to any one who takes the time to read this.

Liam

evets33’s picture

Hello Liam,

Have you find to do different markers ?

Thank you for your help, i have the same probleme of gmap_taxonomy_node empty ! And all my markers are the default markers

Thank you

jrlaforge’s picture

Hello evets33,

I could not add a custom marker either. There was a problem in the path to the icon file. Probably due to the language prefix (i18n). I just change the url to the file to an absolute one.

In the gmap_blocks_content function, I modified the custom icon part by this :

 // If a custom icon is used, create a usable url for it
    if ($location['use_icon']) {
      $block['locations'][$lid]['icon_path'] = $base_url.'/'.$block['locations'][$lid]['icon_path'];
    }

Hope it helps

dunx’s picture

The patch won't work (if it ever did, I've not tested it) since Drupal 6.24 Taxonomy changes to the term structure.

See here for fix:
http://drupal.org/node/1443146

But, I still can't get multiple term markers stored for a node in gmap_taxonomy_node because of the table structure.

How do you have multiple term-based markers for a single node?

The only way I can think of is saving a composite record in gmap_taxonomy_node, e.g. vocab 1 term 5 = "blue" markers and vocab 2 term 12 is "circle" marker and then create "blue", "circle" and "blue circle" markers having stored "blue circle" in gmap_taxonomy_node. It can't be that difficult surely?

distanceroller’s picture

I have assigned a different marker to each of the relevant taxonomy terms. In the past it worked perfectly but it stopped working and I don't know why! Directly following the Node Locations link, which is under http:///map/node, it showed me the different markers. Now, for many locations it shows the fall-back marker. When using views it doesn't show those markers.

I have followed @izmeez solution but it doesn't work. I am getting in the gmap_taxonomy_node_marker a NULL value. The node type created is called 'place' and running the following query:

----------
SELECT node.nid AS nid, gmap_taxonomy_node.marker AS gmap_taxonomy_node_marker, node.title AS node_title, node.language AS node_language, node.type AS node_type, term_data.name AS term_data_name, term_data.vid AS term_data_vid, term_data.tid AS term_data_tid
FROM roll_node node
LEFT JOIN roll_gmap_taxonomy_node gmap_taxonomy_node ON node.vid = gmap_taxonomy_node.vid
LEFT JOIN roll_term_node term_node ON node.vid = term_node.vid
LEFT JOIN roll_term_data term_data ON term_node.tid = term_data.tid
WHERE (
node.status =1
)
AND (
node.type
IN (
'place'
)
)
ORDER BY node_title ASC
LIMIT 30 , 30

----------------

I get a NULL value for the gmap_taxonomy_node_marker (see the attached file). So, many places are not shown because there is no marker for them when I am using a view. Or they are shown as the fall-back marker when using Node Location.

I have cleared the cache and regenerated the marker cache.

I am using: Drupal core 6.24, GMap Module 6.x-1.1, and Location 6.x-3.1.

Any ideas?

Thanks in advance!

izmeez’s picture

Version: 6.x-1.1-rc1 » 6.x-1.x-dev

Yes, there is definitely a new issue here. We are also experiencing the loss of the taxonomy selected gmap markers. Not sure where in the update process it began. We are using gmap-6.x-1.x-dev from 2011-Mar-31 and the latest Drupal 6 release.

izmeez’s picture

Category: feature » bug
Priority: Critical » Major

I followed @dunx over to http://drupal.org/node/1443146 from comment #40 above to see what is developing over there.

Now I'm wondering if that issue and this issue are duplicates?

Also, since this was working before and in use on production sites I hope no one minds the change to a bug report and adjusting the priority down a tad.

matt2000’s picture

Status: Active » Reviewed & tested by the community

The fix in Comment 35 works against 6.x-1.x-dev.

@Users -- remember, nodes need to be re-saved after applying this patch in order for the assigned marker to take affect. Depending on the state of your site, you may also need to resave the marker selection on the Term settings form.

webservant316’s picture

The fix in Comment 35 works against 6.x-1.x-dev also worked for me.

asiby’s picture

Hello everyone.

I just thought that it was worth mentioning that when a modification requires that you re-save all the affected node (ref #44), then you do not have do edit each node and re-save it. You can simply filter the content list in the content administration area (admin/content/node in Drupal 6), then select all the filtered nodes, and apply a batch modification task to them. For example, if they are already published, then publish them again. That will end up changing the status and saving each and every single one of them. Et voila!

Cheers

asiby’s picture

The fix in Comment 35 worked against 6.x-1.1 for me.

hoporr’s picture

Confirming: the patch in #35 works against 6.x-1.x-dev, and Drupal core 6.25.

This is a pretty significant issue and the fix should be added into the module as soon as possible.

izmeez’s picture

Also confirming the fix in #35 works after it is applied and the nodes are saved again as described in #44 and #46. Unfortunately the re-saving changes the date of nodes unless the node update is hacked.

sdutt28’s picture

The patch provided in #35 worked for me as well. I have GMAP v6.x-1.1. Thanks!

MrE’s picture

I installed the patch but am still having issues. I have a content type which is a questionnaire. One of the questions is gender, Male, Female. Male and Female are taxonomy terms and I have set a blue marker for Male and Pink for Female. When I go to create the view I add the Content:Gender field under Fields and Marker Handling as "By Term" and get a nice map but all of the markers are the fallback marker, all a single color. Is it a views config issue? Bug in GMap? Any help is greatly appreciated.

JCB’s picture

I can confirm the patch in #35 worked for me as well.
I also re-saved all terms as well as all nodes (not sure if this was required).

podarok’s picture

Status: Reviewed & tested by the community » Needs work

#35

git apply --check gmap_taxonomy_1.patch
error: patch failed: gmap_taxonomy.module:128
error: gmap_taxonomy.module: patch does not apply

this patch does not apply to current 6.x-1.x
need reroll

izmeez’s picture

Version: 6.x-1.x-dev » 6.x-2.x-dev

Can anyone comment on their experience with gmap-6.x-2.x and this issue. Is it working or not? Thanks.

LittleRedHen’s picture

This is still not fixed in 6.x-2.x-dev (or 6.x-2.0-beta1).
Manually applying the patch from comment #35 corrects the problem.

vlooivlerke’s picture

In 6.x-2.x-dev Manually applying the patch from comment #35 corrects the problem.

There is still a problem if you have nodes with no markers in a view, the no marker nodes don’t fall back to the default marker but inherits a marker icon from another node with a marker. Wierd

socialform’s picture

Issue summary: View changes

I have the same bug as vlooivlerke in #56 .

For views using a marker field handling... the "Marker / fallback marker to use" in views settings isn't respected. Nodes that leave that field empty are rendered with the same pin as the last node saved.

relates to https://drupal.org/node/566660

does anyone have a solution to this? thanks

elshae’s picture

Was this ever fixed? I have read this thread multiple times and have tried everything but the patch. I still cannot get taxonomy markers to work :(

elshae’s picture

Finally gave in and applied the path from #35 on the 6.x-2.0-beta5 branch. It's working for me and I am having the same weird behavior mentioned in #56.

imclean’s picture

Based on #35, this should take into account multiple terms and vocabularies as mentioned in #36, although this hasn't been tested.

The patch is against latest 6.x-1.x in git but may work with 6.x-2.x.

imclean’s picture

Version: 6.x-2.x-dev » 6.x-1.x-dev
Component: Miscellaneous » Code
Status: Needs work » Needs review

Update status.

johnzzon’s picture

Patch in #60 got it working for me.

podarok’s picture

Status: Needs review » Fixed

#60 commited

  • podarok committed d20beb4 on 6.x-1.x authored by imclean
    Issue #205944 by imclean, cjs@rabash, bdragon, distanceroller, alesr,...
podarok’s picture

Version: 6.x-1.x-dev » 6.x-2.x-dev

  • podarok committed c023362 on 6.x-2.x authored by imclean
    Issue #205944 by imclean, cjs@rabash, bdragon, distanceroller, alesr,...

Status: Fixed » Closed (fixed)

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