One solution for "Javascript is required to view this map." in Drupal 6 GMap module

I've been using GMap module for Drupal 6 for a while. Once I changed the theme from Garland to my own. The map page said only "Javascript is required to view this map".

I googled and found that I should include a javascript tag via drupal_add_js() function, but the scripts are already there when I did view source. Comparing with the working source, the missing piece is

<script src="http://maps.google.com/maps?SOME_VALUE" type="text/javascript"></script>

which is not included in a Drupal variable $script.

After comparing the page.tpl.php of the two themes line-by-line, the problem is that there was no $head in my new theme. I just inserted

<?php print $head ?>

before the line

<?php print $styles ?>

and the map appears.

8 comments

Toy wrote 2 years 50 weeks ago

อยากเขียนโปรแกรมเก่งๆบ้างอะพี่สน
ต้องเริ่มที่แรงบันดาลใจรึปล่าว
พอคิดว่าอยากจะเข้าไปหาอะไรใหม่ๆอ่าน
ก็ไปจบที่ kapook กะ dek-d.com ทุกที
ห้าๆ
ขอความช่วยเหลือ
หรือ คำแนะนำ
หรือ คำบ่นๆ

tewson wrote 2 years 50 weeks ago

เราก็ไม่เก่งจ้ะ อาศัยมวยวัด ครูพักลักจำ ถึกควายทุย และกูเกิ้ล

gwaine wrote 2 years 27 weeks ago

Thank you for posting this! It fixed my problem!

Michael wrote 2 years 1 week ago

Thanks for this. I spent 2 days trying to figure out why I couldn't get the map to show up. Cheers.

Bruce Clark wrote 1 year 32 weeks ago

Thanks mate
So simple after having spent about an hour trawling the Drupal site! :o)

Harnarayan wrote 47 weeks 6 days ago

I am very thankful for the response I was facing same issue and it resolved my issue.

Jaisenan wrote 24 weeks 6 days ago

Thanks tewson! Its worked for me.
Very helpful post!

Anonymous wrote 4 weeks 6 days ago

Thanx for share this

Add your comment

The content of this field is kept private and will not be shown publicly.
  • You can use Markdown syntax to format and style the text. Also see Markdown Extra for tables, footnotes, and more.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

Links

Recent comments