javascript is required to view this map is what I get

Comments

solipsist’s picture

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.

Good luck!

solipsist’s picture

Status: Active » Closed (fixed)
yann_riviere’s picture

Version: 6.x-1.0-beta3 » 6.x-1.0-beta6
Status: Closed (fixed) » Needs work

hmm, 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

yann_riviere’s picture

Hello,

Did this report is ok for you or must i re-open one?

Thanks

iaminawe’s picture

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.

Thanks for a great module
Gregg

gooddesignusa’s picture

I 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

hihappycats’s picture

Priority: Normal » Major

Subscribing

oskarg’s picture

Subscribing.

Is there any working solution for this problem?

doublejosh’s picture

Subscribing.

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.

dela.deyoungster’s picture

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.

Any solutions yet?

codigovision’s picture

Status: Needs work » Needs review

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

Here is a list of the scripts:


<script type="text/javascript" src="/sites/default/modules/gmap/js/gmap.js?E"></script>
<script type="text/javascript" src="/sites/default/modules/gmap/js/marker.js?E"></script>
<script type="text/javascript" src="/sites/default/modules/gmap/js/highlight.js?E"></script>
<script type="text/javascript" src="/sites/default/modules/gmap/js/gmap_marker.js?E"></script>
<script type="text/javascript" src="/sites/default/modules/gmap/js/poly.js?E"></script>

<script type="text/javascript" src="/sites/default/files/js/gmap_markers.js?E"></script>
<script type="text/javascript" src="/sites/default/modules/gmap/js/icon.js?E"></script>
<script type="text/javascript" src="/sites/default/modules/gmap/js/markerloader_static.js?E"></script>

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