Needs work
Project:
GMap Module
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
26 Mar 2009 at 19:15 UTC
Updated:
8 Jan 2012 at 07:10 UTC
hi there,
I've got big trouble because I can't get it to work. I want to get the map working
when I partially reloa site content where the map is in.
I always get the message: Javascript is required to view this map. when using Ajax :(
does somebody know how to get gmaps re-started?
I found only a singlepost that notes by using "Drupal.gmap.setup();" after the partial load
would fix it. but this does not work for me. It's sugested for Drupal 5 :(
thx and best regards,
melchior :)
Comments
Comment #1
bdragon commentedYeah, it's a bit of a problem. I never envisioned rebooting the maps when I originally wrote the code, so there are a lot of gotchas.
Here is an *experimental* method that may allow you to successfully reboot a map.
It won't detatch any external controls, which will stop working when the map is rebooted. I don't know how to solve this issue in D5, which is why the whole idea is experimental. (The solution in D6 involves namespaced event handlers, but I haven't committed the changes required for this because it would make the code diverge significantly.)
Comment #2
melchior commentedDrupal.gmap.unloadMap(mapid);
works like a charm!
thx!
Comment #3
uprojects commentedMaybe in the future release ?
Comment #4
Pantze commentedHi!
I am having the same problem. I just wonder though, where I should put the code presented by bdragon?
Which hook? Or someplace else?
Regards Pantze
Comment #5
ctalley5 commentedsubscribing...
Comment #6
bartezz commentedI have the same problems.
The map shows fine, but when one selects something form the exposed filters and clicks 'apply' I get "Javascript is required to view this map".
This only happens when I use AJAX which I desperately need!
Can anyone (Melchior) tell me where to put the code given in the examples to re-init the map?
Cheers
Comment #7
PaulHruska commentedI've posted a possible solution (it works for me) on thread: http://drupal.org/node/315236 which has a longer more detailed discussion of this problem.
Cheers.
Comment #8
gagarine commentedI have something like that to perform a ajax load from a view with node teaser to the complete. The map is not present on the node teaser and when they are load from the complete node with ajax i have the "Javascript is required to view this map." and after i use the code from #1 i have nothing displayed.
and the field after loading
ha... and in my module i have this code to run gmap on a page without gmap..
Comment #9
gagarine commentedOk... after some houres a not so bad solution.
First JS is not executed with load if the result containt a body or head. So first in my theme
File: ajax-page.tpl.php
File: template.tpl.php
After in a module i load a costum JS with this
An important thing is to load all JS files needed by geo in the php file of your module
All this code need cleanup but I hop it help.
Comment #10
EvanDonovan commentedSubscribing to come back to tomorrow - I will look into whether I can figure out how to get the unloadMap and attachBehaviors code to work in the context of a Quicktabs block that loads via AJAX.
Comment #11
gooddesignusa commentedSubscribing. I was trying to set up a view that used http://drupal.org/project/viewsdisplaytabs which requires ajax to be used. Hopefully this is the right spot to mention the issue since I only get the JS msg when i enable ajax on my view.
Comment #12
ranukau commentedi m having same issue.. i m trying load the map using javascript..
but it says javascript is required to run the map.. my php file is returning correct data.. if i put the unload function where should i put that?
Comment #13
ranukau commentedmy problem resolved!
Rather than creating a map obj in a php.. what i did was i just retrieve the necessary data array using a php file and then called the following function which i created! problem solved!
this worked for me...!