My use case is getting gmap to show up in a view that is displayed in a tab from tabs.module.
I couldn't figure out how to pass different lat/lon parameters into the gmaps view, so I tried making the map microformat ([map...]) in a node, and then putting the node in a view.
This worked for the node, and for the view, but not with the view in a tab.
So, I tried putting the HTML generated by Drupal from the microformat into the node (with Full HTML on). The HTML extremely verbose, and includes a script.
It worked!
(Although I feel that the microformat should work. Also, using the gmaps view, it's very unclear from the error message whether the lat/lon in fields, or the lat/on in filters is to be used. And no matter what I tried, I still got grey. That's why I've filed this as a bug report.)
Comments
Comment #1
lambert-1 commentedNo, it didn't work. The script doesn't work, all that's gotten is the image, nothing is dynamic.
So this is a bug.
Comment #2
meximese@drupal.org commentedI think this is a similar issue: http://drupal.org/node/128658
It seems GMap and JsTools don't like each other
Comment #3
mnlund commentedI've managed to display the map with the jstools tab module. It works with some tweaks. I use gmap views to display node maps, and want them to show up in tabs. I also made the tabs module suppport ajax, but this seems impossible to work with gmap, and maybe a to heavy feature, especially now, when you can bind markers as you want. But maps in tabs is a nice feature, but to make it work I have to call the Drupal.gmap.setup() function on tab change in tabs.js. This is not preferable, when the map loads two times. The first one on page load, and the second one on tab change. What I think is possible is to make a bind function to the gmap; on tab change. The best solution will be to redraw the map on tab change, and this bind should be placed in a gmap_tabs.js file in the bas module. I do think it is the right choice to make tabs support gmap, and not vice versa. I will look into this, but some help would be nice. I'm not steady on javascript bind, but hopefully I will be able to figure it out.
Comment #4
michelleI tried the tip in #3 with the help of someone who knows a bit of js and got:
This works great on the tabset where I have the map. Unfortunately, this affects wherever the tabs module is used and caused an error of "too much recursion" on another set. I'm wondering if anyone has had any more luck with this and has a better place to put it? The comment implies that this isn't the best way to do it but there's no further follow-up.
Thanks,
Michelle
Comment #5
michelleOk, thanks to bdragon, I've got this working on my site. Hopefully this can help someone else.
On the page that has the tabs with a map, you need to add:
Then, in tabs.js you need:
That's working for me.
Michelle
Comment #6
(not verified) commentedComment #7
rickmanelius commentedThis doesn't seem to translate to 6.x