Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I'm attempting to show a map from a Location Field on a node details page, and receiving the dreaded "Javascript is required to view this map" error regardless of whether I'm using Safari or Firefox or whether I'm logged in or not. Also, I don't have "Aggregate JavaScript files" set, and toggling that setting doesn't appear to have any effect.
I did a view source on the page and I have noticed that the "gmap_markers.js" is not listed in the script imports.
Comment | File | Size | Author |
---|---|---|---|
#64 | 1061444-7.x-1.x.patch | 1.41 KB | podarok |
#26 | gmap_javascript_is_required_1061444-multi-site.patch | 1.53 KB | zabelc |
#13 | gmap_javascript_is_required_1061444.patch | 1.49 KB | tbenice |
Comments
Comment #1
Jarode CreditAttribution: Jarode commentedSame issue. :-(
Comment #2
aqua_linksunten CreditAttribution: aqua_linksunten commentedHi, I have the same problem. I looked a bit in the gmap.module-file and noticed that in there a gmap-markers.js is referred to instead of the gmap-marker.js-file
Comment #3
najibx CreditAttribution: najibx commentedWhen I look at the page source, the gmap JS not even loaded. To prove this, I added the following inside , in my case .. in modules/system/html.tpl.php (never hack the core, this is just for test). So must be a bug somewhere ...
Comment #4
Agence Web CoherActio CreditAttribution: Agence Web CoherActio commentedsubscribing
Comment #5
JimR CreditAttribution: JimR commentedHaving the same issue :(
Comment #6
Renegadez CreditAttribution: Renegadez commented++
Comment #7
rofsky CreditAttribution: rofsky commentedsame
Comment #8
fuse CreditAttribution: fuse commentedsubscribing
Javascript files are not beeing added inside
<head></head>
. Adding them to html.tpl.php manually like Najibx suggested works, but of course this is not the right way to solve this bug.Comment #9
litzastark CreditAttribution: litzastark commentedTo do this without hacking core, try adding this code to your template.php:
This worked for me, at least!
Comment #10
zabelc CreditAttribution: zabelc commentedActually, I just happened to realize: the map appears just fine for me when when I'm editing a node and when I have a GMap View.
This leads me to conclude that the gmap_markers.js isn't being added to the node view.
Anyone know which file controls that?
Comment #11
elgandoz CreditAttribution: elgandoz commentedsubS
Comment #12
tbenice CreditAttribution: tbenice commentedsame problem, subscribing.
Comment #13
tbenice CreditAttribution: tbenice commentedI think this is the problem: for some reason all js injections were removed or commented out of the 7.x-dev version.
1) js is injected in _gmap_doheader() and it's commented out.
2) js is added in gmap_gmap pre-render $op and it's not there. I added it back in and it works. I'm not sure if the maintainer is planning to put it in the _gmap_doheader() function instead, but i've provided a patch in case this is ok.
-Ted
Comment #14
JVA-1 CreditAttribution: JVA-1 commentedPatch #13 fixed the problem on D7, thanks
Comment #15
tbenice CreditAttribution: tbenice commentedwill this work for dev?
Comment #16
zabelc CreditAttribution: zabelc commentedIt worked for me on 7.x-1.x-dev.
Comment #17
tbenice CreditAttribution: tbenice commentedComment #18
bryancasler CreditAttribution: bryancasler commentedsubscribe
Comment #19
bryancasler CreditAttribution: bryancasler commented#13 works
Comment #20
rlangille CreditAttribution: rlangille commentedI can confirm #13 works on a vanilla install with dev.
Update: Note, this will fail if you are using multi site installs, as the patch points at default files instead of the site's files.
You may wish to change
drupal_add_js('/sites/default/files/js/gmap_markers.js');
to
drupal_add_js(variable_get('file_public_path', conf_path() . '/files') . '/js/gmap_markers.js');
At least until a better solution is found.
Comment #21
basicmagic.net CreditAttribution: basicmagic.net commentedsubscribe
Comment #22
elgandoz CreditAttribution: elgandoz commented#13 works for me on GMap 7.x-1.x-dev (2011-Mar-11). Thanks!
Comment #23
thetruthkc CreditAttribution: thetruthkc commentedThanks #13 worked for me.
for the newbies (like me), i had to patch from the gmap directory, not the root install directory as suggested by http://drupal.org/patch/apply
patch -p0 < gmap_javascript_is_required_1061444.patch
Comment #24
botanist CreditAttribution: botanist commentedSubscribing...#13 did not work for me unfortunately. Ran the patch as #23 suggested and all js files appear in source (and are accessible through the browser). Not sure what else could be wrong. Updated to the April 1st 7.x-1.x-dev version and no luck.
Comment #25
vodkov CreditAttribution: vodkov commented#13 worked for me! Thanks.
Comment #26
zabelc CreditAttribution: zabelc commentedI updated the tbenice's patch from #13 to per the multi-site instructions offered by rlangille in #20. This version is attached for review.
Though I don't have a multi-site install, it seems to work for me. Any chance we can get this rolled into the dev branch soon?
@botanist, you might try clearing your site's cache a couple times (I saw another post that mentioned that one clear might not be enough so I always do it twice if only for the sake of superstition).
Comment #27
phayes CreditAttribution: phayes commentedsubscribe
Comment #28
gg4 CreditAttribution: gg4 commentedsubbing
Comment #29
yaworsk CreditAttribution: yaworsk commentedConfirmed that patch in #13 worked for me as well with rlangille fix for multisite (huge thanks to you both!)
for reference, I was having the problem on profile pages created with the profile2 module.
pete
Comment #30
movemaine CreditAttribution: movemaine commentedMore oddness - I get this same error unless I enable a Location block. And then the map shows in the block and in the content.
Comment #31
NathanM CreditAttribution: NathanM commentedSubscribing.
Comment #32
betarobot CreditAttribution: betarobot commented#26 worked for me just perfectly. Thanks! Hope to see it committed soon.
Comment #33
Technonow CreditAttribution: Technonow commented13 worked for me EXCEPT it works and I can view maps and markers when I am viewing as a visitor and NOT logged in!
When I log in, maps and markers disappear and I can only see "Javascript is required to view this map".
Anyone know the cause or can point me in the right direction please.
Using
Drupal 7.0-dev
Gmap 7x 1x-dev
Location 7x 3x-dev
Comment #34
lolmaus CreditAttribution: lolmaus commentedSubscribing
Comment #35
Anonymous (not verified) CreditAttribution: Anonymous commentedI applied from #13 as well and now the map appears but I do get the marker.
I use:
gmap 7.x-1.x-dev from April 1st
location 7.X-3.x-dev from April 6th
I cleared the caches a few times and regenerated markers but no result.
Comment #36
robotcake CreditAttribution: robotcake commentedSubscribing
I as well don't get the marker
Comment #37
JulioGuedes CreditAttribution: JulioGuedes commentedAt first, i had applied patch #13, and it solved the message problem, but the markers didn´t work. But i deleted the module, installed it again and applied patch #26 and solved both problems. It´s working fine now! Thanks guys!
Comment #38
Anonymous (not verified) CreditAttribution: Anonymous commented@JulioGuedes: thanks for the hint. I looked at both patches and went back to the gmap.module and manually changed the line with the gmap.markers.js code to the code as in patch #26 and it solved my marker problem as well (no need to uninstall and reinstall the module).
"drupal_add_js(variable_get('file_public_path', conf_path() . '/files') . '/js/gmap_markers.js');"
Comment #39
avizzino CreditAttribution: avizzino commentedSubscribing
Patch works, but I get the same problem with the marker!
Drupal 7.0
gmap 7.x-1.x-dev
location 7.x-3.x-dev
EDIT: #38 works well for me!
Thanks!
Comment #40
mrgoltra CreditAttribution: mrgoltra commentedsub.
Comment #41
mrgoltra CreditAttribution: mrgoltra commentedI got a Hunk #1 FAILED at 127 when I applied #13 patch. It seems to be working.
Comment #42
RCollins17 CreditAttribution: RCollins17 commentedUnfortunately I am hosted on GoDaddy and they will not allow the patch command on shared servers. That said, where in the gmap.module would I copy the patch?
Thanks
Comment #43
mrgoltra CreditAttribution: mrgoltra commentedYou can do it locally and upload the patched files
Link on how to apply patch on Windows (assuming you are using windows)
http://drupal.org/node/620014
Comment #44
celston CreditAttribution: celston commentedSubscribe. Patch from post #26 appears to work under core 7.0, GMap 7.x-1.x-dev (4/1/2011) and Location 7.x-3.x-dev (4/6/2011).
Comment #45
slackrunner CreditAttribution: slackrunner commentedsubscribing
Comment #46
Glottus CreditAttribution: Glottus commentedGreat! #26 is really helping me now, thanks!
Comment #47
gooney0 CreditAttribution: gooney0 commentedThank you. This patch worked for me using version gmap 7.x-1.x-dev (2011-Mar-31) and Drupal 7.2.
Comment #48
dimapv CreditAttribution: dimapv commentedI'm apply #13 patch - Gmap is appears, but markers was missed. I apply just 1 row from #26 patch with this: drupal_add_js('sites/default/files/js/gmap_markers.js');
but without the first '/' before 'sites'. All works perfectly.
Comment #49
RonP CreditAttribution: RonP commentedSo when fooling around with settings I got this error come up. Don't know if it helps.
Notice: Undefined index: revision table in field_views_field_default_views_data() (line 182 of /home/railrout/public_html/sites/all/modules/views/modules/field.views.inc).
Otherwise subscribe (-=
Comment #50
joelstein CreditAttribution: joelstein commented#26 worked for me.
Comment #51
tahiticlic CreditAttribution: tahiticlic commentedI think this function should avoid to redeclare the js inclusions : _gmap_base_js
By the way, with JS aggregation, you should read this : http://drupal.org/node/1244314
Comment #52
bentleychan CreditAttribution: bentleychan commentedsubscribe
Comment #53
Summit CreditAttribution: Summit commentedSubscribing, greetings, Martijn
Comment #54
coloryan CreditAttribution: coloryan commentedThe patch in 26 worked for me, thanks zabelc.
Comment #55
thorprichard CreditAttribution: thorprichard commentedFrom our troubleshooting of this nightmare, it appears that this bug in the Admin module may be the cause: http://drupal.org/node/969916
(Applying that patch was all that was needed to get gmap to correctly display in a view.) Your mileage may vary.
Comment #56
dimon00 CreditAttribution: dimon00 commentedHaving the same problem on the last dev release.
The patch #26 doesn't seem to help.
The map is showing only with ajax disabled.
Comment #57
dorian_ CreditAttribution: dorian_ commentedHi everybody,
modifying the gmap_markers.js in /sites/default/files/js and pointing to a custom marker-directory works fine.
Has anybody cleared the theme-cache after doing that?
It generates a new gmap_markers.js with the default path-settings :-(
Is there a way overriding a function and putting it to the template.php?
The following does NOT WORK:
Any ideas?
Comment #58
locavore CreditAttribution: locavore commentedI ran into this problem (or at least a very similar problem telling me that Javascript is required to view the map) on a v7 site several weeks ago. I tried all of the recommendations shown in the posts above including disabling the various modules, patches, reconfiguration, uninstalled and re-installed, etc... and nothing helped.
Sent a note the help desk at my host (Hosting Metro). It took them about 10 minutes to fix and everything works perfectly now. It was a mod security setting..
Comment #59
Macronomicus CreditAttribution: Macronomicus commentedlocavore ... did they tell you which mod security in particular?
Ive tried the patch in #26 and still cannot use ajax on a gmap view with filters.
Comment #60
jsj9832 CreditAttribution: jsj9832 commentedLine 18:
Error: Object doesn't support property or method 'getPoint' for highlight.js.
It happens in IE8/9 when clicking on the markers.
Solved by in Gmap configuration. I unchecked Highligts in the Gmap settings page. Now my map is fully working.
Comment #61
haiiro.shimeji CreditAttribution: haiiro.shimeji commented@jsj9832
ok, it seems the different problem from in this thread, but about upgrading to API ver3.
I'll make the patch code in http://drupal.org/node/1586432, please try it.
Comment #62
swfindlay CreditAttribution: swfindlay commentedI tried all sorts of solutions to this problem, and eventually came across this: http://drupal.org/node/1052372#comment-4392638
The solution is go to configuration>performance>enable and "Aggregate JavaScript files".
I hope this helps others! (It would've saved me 2 days!)
Comment #63
podarok#26 commited to 7.x-2.x branch
thanks!
Comment #64
podarokthe same patch reroll to 7.x-1.x branch
fixed and commited / pushed to 7.x-1.x branch
Comment #66
johnvIt seems this patch creates a problem. #13 's analysis may be wright, the solution may be wrong.
See my post with additional patch at #923630-29: Markers not showing up on Gmaps no matter what: How to debug
Comment #67
podarok#66 looks like fixed/commited
Comment #68
RWill CreditAttribution: RWill as a volunteer commentedI had the same issue with gmap-7.x-2.x-dev. To resolve it I applied these patches:
https://www.drupal.org/files/issues/gmap-gmap_markers-location-2185395-1...
https://www.drupal.org/files/issues/gmap-esta-turhientiedotojen-luonti.p...