Come together with the global Drupal community in Rotterdam, 28 Sept – 1 Oct 2026. Sessions, contribution, connection, and Early Bird savings until 8 June.
Thank you for reporting this. Please try to take some time and write a proper bug report. I can't help you unless you're specific about what works and what doesn't.
However, given what you wrote, I assume this is due to the Gmap style requiring JavaScript files that aren't loaded when you load the display through AJAX. JS files are added to Drupal on page load, through references in the HTML document's head. When you load a display using AJAX the HTML document is never fully updated/replaced, you merely replace a piece of it and no new JavaScript files are loaded.
You can solve this by adding some code to the View's page display's header that includes the necessary JS files. Have a look at gmap.module or whichever file provides the integration with Views and search for lines that contain "drupal_add_js". Copy these to your View's header and set PHP as input format for the header.
I have been trying to do this only Gmap seems to call so many different js scripts that I have not yet worked out which ones are needed to function correctly. I think I will try quicktabs to see if it works there but would love this to work with views display tabs.
I've seen this same issue in other places where the map is not initially visible and has a kind of "double hide." For example when in a collapsed Location fieldset within a vertical tab that's not the default.
Same issue. I tried Solipsist's recommendation, but yet to no avail. I even used the GMap view as the first view and it loads correclty. But as soon as i switch between the any other view and return, I get the "Javascript is required to view this map" screen.
I was able to get it working using solipsist's recommendation:
place the gmap js files in the views header and set the input type to php (this requires having the php input type enabled and permission to use it etc...)
you can adjust the src to fit your site and where your markers file is located, and it should work.
By the way i first tried using a larger list of scripts and one of them was causing it not to work, the one pointing directly to google, all you should need are the ones in the gmap module and the markers file, if required.
Comments
Comment #1
solipsist commentedThank you for reporting this. Please try to take some time and write a proper bug report. I can't help you unless you're specific about what works and what doesn't.
However, given what you wrote, I assume this is due to the Gmap style requiring JavaScript files that aren't loaded when you load the display through AJAX. JS files are added to Drupal on page load, through references in the HTML document's head. When you load a display using AJAX the HTML document is never fully updated/replaced, you merely replace a piece of it and no new JavaScript files are loaded.
You can solve this by adding some code to the View's page display's header that includes the necessary JS files. Have a look at gmap.module or whichever file provides the integration with Views and search for lines that contain "drupal_add_js". Copy these to your View's header and set PHP as input format for the header.
Good luck!
Comment #2
solipsist commentedComment #3
yann_riviere commentedhmm, i don't understand very well the workaround... :)
I think i have the same issue :
I create a view with 5 displays of gmap sytle.
I want to display this view with views display tabs and have 5 tabs with gmap included.
The first tabs is ok, the gmap is loaded.
The others, i have the issue : Javascript is required to view this map.
So, it describe pretty well what you explain above, but i don't understand the workaround.
Can you help us ?
Thanks
Comment #4
yann_riviere commentedHello,
Did this report is ok for you or must i re-open one?
Thanks
Comment #5
iaminawe commentedI have been trying to do this only Gmap seems to call so many different js scripts that I have not yet worked out which ones are needed to function correctly. I think I will try quicktabs to see if it works there but would love this to work with views display tabs.
Thanks for a great module
Gregg
Comment #6
gooddesignusa commentedI was also trying to set up a view using GMAP and this module. it seems this is an issue with gmap and ajax enabled views
Subscribing
Comment #7
hihappycats commentedSubscribing
Comment #8
oskarg commentedSubscribing.
Is there any working solution for this problem?
Comment #9
doublejosh commentedSubscribing.
I've seen this same issue in other places where the map is not initially visible and has a kind of "double hide." For example when in a collapsed Location fieldset within a vertical tab that's not the default.
Comment #10
dela.deyoungster commentedSame issue. I tried Solipsist's recommendation, but yet to no avail. I even used the GMap view as the first view and it loads correclty. But as soon as i switch between the any other view and return, I get the "Javascript is required to view this map" screen.
Any solutions yet?
Comment #11
codigovision commentedI was able to get it working using solipsist's recommendation:
place the gmap js files in the views header and set the input type to php (this requires having the php input type enabled and permission to use it etc...)
Here is a list of the scripts:
you can adjust the src to fit your site and where your markers file is located, and it should work.
By the way i first tried using a larger list of scripts and one of them was causing it not to work, the one pointing directly to google, all you should need are the ones in the gmap module and the markers file, if required.
If you're using exposed sorts as well, you will need this patch too: http://drupal.org/node/315236#comment-3094092