This one is part of META issue #1931138: Fixing all 'single marker' issues
Hi,
I´ve created a view that displays a gmap with a couple of locations. The view has a couple of exposed filters that default to ANY.
On initial display, the view with the gmap displays just fine. I get a map of with bubbles for the two node locations.
If I then simply click the APPLY button to refresh the view without changing the filter settings from the defaults that have just successfully displayed a map the little ajax whirling graphic displays and then the map disappears and is replaced by the text "Javascript is required to view this map". The only way I can get the map to redisplayt is by forcing a page refresh e.g. SHIFT Refresh.
This is using the latest gmap version. Gmaps appear just fine on nodes and other places I expect them to be.
I´m using the Sept 24 6.x-1.x-dev gmap version.
Comment | File | Size | Author |
---|---|---|---|
#221 | exposed_filters_ajax_error_315236_221.patch | 410 bytes | johnnybgoode |
#208 | exposed_filters_ajax_error_315236.patch | 2.57 KB | haiiro.shimeji |
#207 | exposed_filters_ajax_error_315236.patch | 3.71 KB | haiiro.shimeji |
#201 | gmap-ajax-d7-315236-199.patch | 2.88 KB | berenddeboer |
#200 | gmap-ajax-d7-315236-199.patch | 2.91 KB | berenddeboer |
Comments
Comment #1
jasontanner CreditAttribution: jasontanner commentedAlso, no errors appear in firebug or the error console. I also get the same symptoms in CHrome, IE and Firefox.
Its possible that this might be related to http://drupal.org/node/313416 "Displaying a map in an AHAH result" ??
Comment #2
chlobe CreditAttribution: chlobe commentedSame problem here. Throws "Javascript is required to view this map." The view displays normally as a table, grid etc. Also tried reducing fields to 1 eg country.
Cheers
Comment #3
bdragon CreditAttribution: bdragon commentedTo start with, make sure you're using at least views 2 RC4. There are some ajax problems in earlier versions..
Comment #4
jasontanner CreditAttribution: jasontanner commentedHi Bdragon,
Unfortunately, even after upgrading views from 6.x-2.0-rc3 to 6.x-2.0-rc4 I still get the same problem.
The gmap displays fine on first display but if I click the apply button on the filters the map is removed and the java script message appears.
The drupal log contains no errors and neither are any reported by firebug or the ff error console.
Can you suggest anything else I can do to investigate this further and gather useful information to debug this ?
Comment #5
chlobe CreditAttribution: chlobe commentedHi
I second that, same problem after uprgrading to rc4.
Any assistance gratefully received
Comment #6
atiras CreditAttribution: atiras commentedNo expert here, but I had this (or a very similar) problem and it was fixed -- CSS related, not Javascript. See #266595: "Javascript is required to view this map" in case that helps.
Comment #7
jasontanner CreditAttribution: jasontanner commentedHi Bdragon,
I've upgraded to gmap 6.x-1.0-rc1 and am using location 6.x-3.0-rc1 and views rc4 unfortunately I get the exact same symptoms.
The gmap displays perfectly on the view on the first display (and also if I re-click the link that displays the view page) but if I try to hit the Apply button on the exposed filters the AJAX whirly pic displays and then the gmap is removed and replaced with the "Java script is required" message - and no other errors are reported anywhere - not in firebug, not in the javascript console, and not in the drupal error log.
Could this be related to http://drupal.org/node/313416 "Displaying a map in an AHAH result" where both yourself and bevan hinted that there are likely to be problems with AHAH stuff ?
Comment #8
jasontanner CreditAttribution: jasontanner commentedTemporary Solution: I turned of AJAX in the View Definition - which sucks - but at least I can now progress and await a fix.
Comment #9
bdragon CreditAttribution: bdragon commentedYeah, the AJAX stuff and GMap don't get along very well, unfortunately. GMap wasn't designed to be rebootstrapped, and it will take a bit to get all the corner cases fixed.
Comment #10
Toddv CreditAttribution: Toddv commentedsame issue - subscribing; elaborating: It seems that whether or not Ajax is on I cannot build a gmap view that has exposed options (eg: date, term). My work around is just to build views that are static to the year, or term, which works but it would be great to be able to select a range of years (in my case) and/or taxonomy terms.
It's pretty darn great as it is so I'm not complaining - thanks to the contributors for their work on this and associated modules. TV
Comment #11
mrfelton CreditAttribution: mrfelton commentedsame issue for me.
Comment #12
frdesign CreditAttribution: frdesign commentedSame issue here so I turned Views' ahah off as well, but at this point I'm so thrilled I can now get lat long from my custom country, city tables (thank you!!!!!) I can live with this issue until it's fixed :-)
Comment #13
Anonymous (not verified) CreditAttribution: Anonymous commentedSame Issue here, would love to help but definitely out of my depth. Let me know if I can help test or anything.
Comment #14
restyler CreditAttribution: restyler commentedany news? subscribing
Comment #15
newtoidlooks like in some themes this works fine and not in others, in edit mode i see the maps but not in view mode
Comment #16
dan.crouthamel CreditAttribution: dan.crouthamel commentedI have the opposite problem. With the theme I'm using, and for only one particular content type, I see the map just fine in view mode, but not edit mode ... wish there was some consistency here :)
Comment #17
tonycpsu CreditAttribution: tonycpsu commentedSubscribing.
Comment #18
johan.jacobs CreditAttribution: johan.jacobs commentedHello,
I have the same problem.
But I'm not getting the error message all the time.
I get the Google map in the edit menu but on the node itself, I only see the coordinates "51° 1' 40.0512" N, 4° 28' 46.83" E"
Comment #19
JaceRider CreditAttribution: JaceRider commentedSubscribing. It would appear that the javascript call that renders the map simply needs to be called again once the filter results have been returned.
Comment #20
3rdLOF CreditAttribution: 3rdLOF commentedJaceRider:
Can you give a few more specifics on what you mean?
Comment #21
Nchase CreditAttribution: Nchase commentedsame problem here. Has anything yet came up to solve the issue?
Comment #22
JaceRider CreditAttribution: JaceRider commentedWell, from my understanding (which may or may not be correct)... when the page is loaded, a bit of Javascript is called in order to call for the generation and display of the map. If this call fails for any reason, you will get a text message stating "Javascript is required to view this map."
Hence, on first page load, everything works fine as the javascript replaces the "Javascript is required..." text with the map. However, when you do an ajax replace of the map with views exposed filter, the javascript that generated the initial map does not get called again, and therefore all we are left with is "Javascript is required...".
Make sense? Unfortunately I haven't had the time to delve into the problem much more than this, but if I do come up with some time and can find a solution, I will certainly post it here.
Comment #23
j0k3z CreditAttribution: j0k3z commentedany updates on this bug?
Comment #24
kvvnn CreditAttribution: kvvnn commentedLets get a solution for this.
Are there any functions we can manually fire to re-build the map? What happens to the GMap when we refresh the page? Can we make that happen on our own?
Comment #25
ari-meetai CreditAttribution: ari-meetai commentedSame problem here. Temporarily solved as #8, by disabling Ajax on the view.
Comment #26
kvvnn CreditAttribution: kvvnn commenteddev : kvn : i was thinking of the autocomplete not the map that had to initialize after load: "script type="text/javascript""Drupal.autocompleteAutoAttach();"/script"
kvn : Ah
dev : i will look to see if there is anything i did to make the map work after ajax. i do remember something about that.
kvn : bdragon mentioned that Gmap has issues w/ Ajax here : http://drupal.org/node/315236
"Druplicon" http://drupal.org/node/315236 =" GMap View, 2 Exposed Filters and the error "Javascript is required to view this map" =" GMap Module, User interface, normal, needs work, 2 IRC mentions
dev : kvn : : right. so basically you need to kick off the map initialize again on callback complete for the views filter
dev : there must be a hook for that
dev : or a javascript callback handler you can piggy back off of.
kvn : Thats what I'm looking for, but there is so much code I don't know what to try
dev : are you just using the Gmap plugin for the view?
kvn : yeah
dev : i would actually start with trying to look at the javascript. looking at the server side code will probably make your head spin.
dev : i would start by looking for the init function for the map in the javascript. see what i needs to build correctly (probably wont be too much cause the view probably passes all the data).
dev : then try to piggy back off that
kvn : any idea which js file?
dev : you just want to call that function (basically, cause i am guessing here) when the exposed filter comes back.
dev : let me look. your on drupal 6?
kvn : yeah
dev : or 5?
kvn : I'm assuming probably gmap.js
dev : k
dev : first off, do you have firebug installed?
kvn : yeah
dev : i would recommend it (console) if are working with javascript
dev : console.log(any_object) give you a great print out.
dev : im sure you have found that already
kvn : I haven't seen that actually
dev : i would expect to have to run the Drupal.gmap.setup(settings) function.
dev : in gmap.js
dev : line 60
dev : i would start there anyway.
dev : so try this.
dev : turn on console for your site.
dev : go to your view and do an exposed filter thing so the map goes away (im assumin thats the problem you are having?)
kvn : that as well as some other ajax refresh stuff
dev : then once it is gone, do this in the console... console.log(Drupal.gmap); and have a look at what is there.
kvn : okay, thank you
dev : kvn : : i would assume so
dev : you will probably have to find where the 'settings' are saved, but they are probably somewhere in the Drupal.gmap object and then runDrupal.gmap.setup( settings) and see what happens.
dev : i have not tried to solve this problem, so i am guessing a lot here, but this is how i would approach the problem.
Comment #27
newtoidafter creating/updating it is possible to view the map by enabling a block which displays the map
Comment #28
kvvnn CreditAttribution: kvvnn commentedI think you are having a separate issue, DaveNewton. We can see the maps just fine, but when an Ajax refresh is processed, the maps unload but do not reload. Maybe I misunderstood you?
Comment #29
ctalley5 CreditAttribution: ctalley5 commentedsubscribing
Comment #30
jarchowk CreditAttribution: jarchowk commentedsubscribing
Comment #31
Bartezz CreditAttribution: Bartezz commentedsubscribing
Comment #32
chicagomom CreditAttribution: chicagomom commentedI am getting this error on admin | settings |gmap as welll as on the view I created. Initially (before there were any nodes with data) I could see the map on the gmap settings page. Now all I see is the js message [under default map settings].
Comment #33
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedI get this error when:
I attached a gmap map to a table view exposed the filter
I goto the page
the map and table show up fine
when I select a value to filter, then press enter, I get "Javascript is required to view this map".
Comment #34
ctalley5 CreditAttribution: ctalley5 commentedI was originally getting the same error when filtering... but the gmaps were showing just fine on nodes.
now I just started getting the error on a lot of plain old nodes as well... which were fine before
Comment #35
chicagomom CreditAttribution: chicagomom commentedNever mind. My issue had to do with not having appropriate write permissions for IUSR on c:\windows\temp (IIS7 environ). Setting appropriate permissions solved that.
Comment #36
Bartezz CreditAttribution: Bartezz commentedThink we need to change the title to something like;
GMap View, 2 Exposed Filters and the error "Javascript is required to view this map" upon AJAX update
People are using this thread for other bugs as well when this one is AJAX related, right?
Comment #37
kvvnn CreditAttribution: kvvnn commentedYes.
Comment #38
Bartezz CreditAttribution: Bartezz commentedHere we go... title changed.
I've been firebugging away but I can't seem to find a solution to this.
Has anyone come closer to an answer to this bug?
Cheers
Comment #39
kvvnn CreditAttribution: kvvnn commentedNo, nothing I can find suggests we are any closer to a solution for this. I disabled Ajax on my maps.
Comment #40
PaulHruska CreditAttribution: PaulHruska commented've been digging into this problem for a few days now, and I think I may have identified a work-around.
My specific setup is a compound view of a table, index, and gMap using the 'attachment' feature. (Your mileage may vary.)
After much capturing of IP traffic, and tracing through the code, I was able to verify that the proper gMap response is being returned by the Ajax call (by Views), and is indeed being injected into the browser DOM via the Views ajax_view.js script. It just isn't getting refreshed.
Thanks to bdragon in http://drupal.org/node/414752, the insertion of a 'map reset' seems to resolve the re-display problem (see fix-1).
However in my case, since the re-display is a sub-set of the original display (selection of an index item), the gMap persists in displaying markers that are no longer relevant. This is because the response returned from the server by the Ajax call 'merges' with the prior generation of the gMap. ( jQuery.extend(true,Drupal,{settings:{ etc... ). This has the effect of 'updating' the first few markers with the new information, and 'persisting' the remaining markers in the browser DOM data. Thus when the gMap is re-rendered there are markers for items that are no longer displayed (see fix-2).
Hope this helps...
fix-1:
in gmap.module:
fix-2:
in gmap.js:
Comment #41
Bartezz CreditAttribution: Bartezz commentedHi Paul,
I tested it immediately and it seems to work for me too... I've tested it Firefox (3.5.2 on XP SP3).
In Internet Explorer 7 (7.0.5730 on XP SP3) I think I had some cache problems, it didn't work at first but it does now!
You are the hero of the week!!!
Cheers
PS. I created a patch with your changes and attached it, not trying to steal your credits tho!!!
Comment #42
Bartezz CreditAttribution: Bartezz commentedOops forgot to change the status...
Comment #43
JaceRider CreditAttribution: JaceRider commentedExcellent work PaulHruska!
It is so close -- however, I am running into an issue. On first execution of an ajax refresh, the map does correctly update. However, if I filter it again, I am back to square one.
The only thing that I am noticing that is different between the first call and the second, is unloadMap is getting called twice on the second.
Anyways, I'm going to play around with it and see if I can see what is going on -- but thanks again!
Comment #44
JaceRider CreditAttribution: JaceRider commentedFurther note on the issue... if I select a filter that returns no results, run the call, then select one that has results, the view fixes itself and the map is again displayed.
Comment #45
Lowgain CreditAttribution: Lowgain commentedI have the same problem now with this fix working only once and then messing up.
Not sure if this will help you out at all, but in the gmap.module fix, I added a js alert before unloadMap is called. It alerts properly on page load and the first time you refresh, but the second/third/etc times you update the filter, the alert goes off twice in a row. Could this indicate the cause of the problem?
Comment #46
Bartezz CreditAttribution: Bartezz commentedI've had some issues as well, best way to reproduce;
- Clear all cache and cookies (I use Firefox webdeveloper toolbar for this)
- Close browser and restart
- Surf to the page with your Gmap view
- Make a selection from exposed filters and click apply
:: no results are shown
- now without changing a thing do a CTRL+F5 hard reload
:: now it does show results with the same selected filters!
Will look into deeper on monday. Can you guys check if this is the case with your setup as well?
Cheers
Comment #47
Bartezz CreditAttribution: Bartezz commentedOk, found my problem. The reason it wasn't showing any markers was because gmap_markers.js and markerloader_static.js weren't loaded into head.
This was because I started my view empty by default (Howto is here: http://drupal.org/node/358546#comment-1492012)
So I added +dynmarkers to my view macro hoping this would solve the problem. But it didn't. So I checked the code for the reason and found it in gmap.module.
I've included a patch to enforce marker loading eventhough the view is empty but only when the macro is set to +dynmarkers.
Cheers
Comment #48
JaceRider CreditAttribution: JaceRider commentedI am still having issues where it works the first time the view is applied... and then after that I'm back to the "Javascript is required" message.
Comment #49
Bartezz CreditAttribution: Bartezz commentedThe patch at #41 fixed that "Javascript is required to view this map" for me... Did you clean browser cache and Drupal's cache?
Maybe try to turn off every module that's not nessecary to run the view and see if it works, also try it in Garland and see what happens.
Comment #50
JaceRider CreditAttribution: JaceRider commentedBartezz, do you have your map set up as an attachment or is it the main element of the view?
Comment #51
Bartezz CreditAttribution: Bartezz commentedHi,
I have it as a block display with exposed filters in a separate block. Haven't tested it as a page display actually so maybe that's it!
Cheers
Comment #52
ctalley5 CreditAttribution: ctalley5 commentedWorks for me!!!! You're the man Paul!
Comment #53
Lowgain CreditAttribution: Lowgain commentedany updates yet on the refreshing more than once issue?
Comment #54
Bartezz CreditAttribution: Bartezz commentedLowgain,
Are u using a block or a page display? I'm using a gmap block display and have no issues other then the one mentioned and fixed in #47....
Cheers
Comment #55
Bartezz CreditAttribution: Bartezz commentedLowgain,
Are u using a block or a page display? I'm using a gmap block display and have no issues other then the one mentioned and fixed in #47....
Cheers
Comment #56
Lowgain CreditAttribution: Lowgain commentedmy map is an attachment at the top of another block
Comment #57
Bartezz CreditAttribution: Bartezz commentedTry it standalone... well just as a normal block...
Cheers
Comment #58
Lowgain CreditAttribution: Lowgain commentedI'll give it a shot, but as my view needs to update the results in both the map and a list of the same content underneath, this may not fulfill the requirements of my task :S
Comment #59
JaceRider CreditAttribution: JaceRider commentedI'm with Lowgain on this one. A simple block may work -- in fact -- I bet it does. But we need to figure out why it isn't working when the map is added as an attachment. I've poured over things and can't find the problem.
Comment #60
Lowgain CreditAttribution: Lowgain commentedI really can't say what happened, but the problem seems to have solved itself! Once I'm finished completing the project I'll try to find time to backtrack and discover what fixed it.
Comment #61
kvvnn CreditAttribution: kvvnn commentedWould this patch work for the CCK Location Field - Lat/Long Chooser map ?
I have a popup to add a node w/ a location field in it.
Update : the patch allows the map to be loaded via ajax, but there are other issues w/ selected a location from the Location CCK Coordinate chooser map going on, that I cannot isolate.
I'm also having a map disappear completely when using Ajax - Views Refresh in a Quicktabs setting. We might be missing some other Ajax issues within GMap with these patches.
I don't think I would change the status just yet, there are still issues at hand that this patch does not address (and maybe it shouldn't - the scope may be too broad here).
Comment #62
Bartezz CreditAttribution: Bartezz commentedI reckon we can change the status of this post now, hopefully the patches will get committed soon!
Cheers
Comment #63
HnLn CreditAttribution: HnLn commentedIssue I have after implementing the fixes from #40 is if your result views is empty, you get nothing (seems ok), but if you then go back to all, the map is gone.
Comment #64
Bartezz CreditAttribution: Bartezz commentedTry and set the empty text and include a gmap macro into this (make sure the input filtyer you are using for the empty text is gmap macro enabled).
I think your problem is that the gmap nessecary javascript isn't loaded on first page load because the result is empty, then if you update the view via Ajax the page doesn't know what to do with all the variables returned by views...
Cheers
Comment #65
morbiD CreditAttribution: morbiD commentedThe patches fix the case where you start with at least one result at page load. However, as HnLn says in #63, if the page loads with an empty result set and you apply a filter, the "Javascript is required to view this map" error returns.Bartezz's suggestion in #64 does not work for me - it loads a default gmap when there are no results, but that map then stays there regardless of what filter values you apply afterwards. It just doesn't update at all. You're basically replacing the error message with an empty gmap which still doesn't respond.Changing status to "needs work" since I don't see a point in committing this until both use cases are covered i.e. starting with or without results.Incidentally, the patch in #41 fails to apply against the current dev version because in gmap.module
has become
Comment #66
jdidelet CreditAttribution: jdidelet commentedSubscribing
Comment #67
morbiD CreditAttribution: morbiD commentedHmm, apologies due to Bartezz - the problem I was experiencing in my last post was apparently due to my gmap.js somehow not being patched. All seems to be working great now that I've patched that file manually, so another thumbs up for getting it committed.
Seems like we just need an updated patch to take into account the changes in the current dev version and it'll be good to go. I'd reroll the patch myself but I'm not sure how to deal with those changes.
Comment #68
Bartezz CreditAttribution: Bartezz commentedNo worries :)
Comment #69
Kristen PolI applied the patches from #41 and #47 to the 1.0 version of gmap and THEY WORK BEAUTIFULLY!! I am a very very happy camper.
I hope these get into the module soon... I'll be happy to test a reworked version of the patch(es) with the latest dev if someone creates them.
Thanks!!
Kristen
Comment #70
nielt CreditAttribution: nielt commentedHow can the issue raised in #65 be addressed? The method for adding javascript to the page has changed completely.
Comment #71
Bartezz CreditAttribution: Bartezz commentedYou are welcome to do so...
Comment #72
morbiD CreditAttribution: morbiD commentedPersonally, I've just reverted the javascript insertion code to the old style so that I can still apply the patch.
Anyone have any problems using the location picker at user/*/edit to set user locations? I get the "Javascript is required to view this map" error there because the code in the patch is apparently unloading the map at that path. Adding a condition around the code seems to fix it for me:
Can anyone reproduce the problem I'm describing? It's always possible I've cocked up my installation somewhere so it would be useful if someone can confirm it.
Comment #73
BetaFlasher CreditAttribution: BetaFlasher commentedI had the same issue with GMap as an attachment using Ajax - After applying exposed filters for the second time, "Javascript is required to view this map" showed instead of GMap.
I messed around this a lot and I couldn't find solution for this issue anywhere. But today is my lucky day and solved this issue by myself :)
The problem was with Views module -> "ajax_views.js". I use Views-2.6 (I downgraded Views because of empty content in GMap bubbles). First of all, I noticed that pager with Ajax works perfect and GMap shows all the time and that's why I tried to get how pager works in "ajax_views.js". I compared it with exposed filters and noticed that exposed filters have something missing. Exposed filters don't have these command lines:
So, that's why I added lines mentioned above before command lines of exposed filters and as in pager, I changed this line:
eval(callback)(view, response);
to this:
eval(callback)(target, response);
In overall, just replace these command lines in "views/js/ajax_views.js":
to these:
This solution works like a charm with Views-2.6. If you test it with higher version of Views then please let me know how it works.
EDIT: I just noticed that map doesn't work if Views return empty results for the first time filtering. If Views return even one result for the first time filtering then with my solution GMap works OK. Any ideas for this?
Comment #74
Bartezz CreditAttribution: Bartezz commentedHave a look at #47
Comment #75
BetaFlasher CreditAttribution: BetaFlasher commentedThank you! It really helped to solve my issue, now everything is working!
I applied your patch, added argument for GMap in Views to always show values and in empty text field I added GMap macro, so GMap shows all the time.
Comment #76
Anonymous (not verified) CreditAttribution: Anonymous commentedI tried the solution at #73 but it did not work for me with Views 2.8. I'll try downgrading to 2.6 but there are some features in 2.8 I want to keep
Comment #77
Anonymous (not verified) CreditAttribution: Anonymous commentedUsing View 2.6 or Views 2.8
GMap 6.x-1.x-dev
Location 6.x-3.x-dev
Could not get the solutions proposed at #73 or #40 to work.
If I try #73 I get the 'Javascript is required to view this map.' message.
With #40, I replaced:
drupal_add_js(array('gmap' => array($element['#map'] => $map)), 'setting');
with
and did the fixe to js/gmap.js
But when I use my filter, the AJAX spinner shows, spins, and never stops spinning
Comment #78
greenbeans CreditAttribution: greenbeans commentedHaving the same problem with AJAX paging.
Comment #79
kvvnn CreditAttribution: kvvnn commentedCheck this out : http://demo1.drupella.com/ajax-gmap
I've contacted the website maintainers for support over here. I'd like to see their method of using Ajax w/ Gmaps.
Comment #80
greenbeans CreditAttribution: greenbeans commented@kevin riggen -- have you heard anything back from that site?
Comment #81
Fabianx CreditAttribution: Fabianx commentedHI,
I got a nicely working solution, which can be implemented as a module (!), however I have not yet done so, due to time issues. :-)
First here is the patch, then I describe how the module would work:
In views/includes/ajax.inc:
In ajax_views.js:
The idea is quite easy:
The map is not updated as the gmap is no longer sending its code via
command, but instead adds it directly to the header. But that means that the net markers data is only available in Drupal.settings.gmap, which is not transmitted. So I extend the object to a settings field, to transmit the settings over the network. I then extend the ajax_views.js, in the Drupal.Views.Ajax.ajaxViewResponse function to update the GMAPs using some variant of the code posted here and in another thread. Now comes the clou, we can add this to a custom module, lets call it gmap_ajax: It would work as follows (I hope I have time to actually implement / test that later on): Instead of hacking the code in views, we can add the setting information via the hook_ajax_data: The we can add our custom Javascript code to some additional Javascript file and now we just need to make sure its loaded by adding the code via some drupal_add_js magic. Anyone got an idea where we could best hook into to add the JS only if we are in a view with a gmap? Here is the JS file: The above code is for discussion for now. Open tasks: Find a way how to re-initialize a map with markers that first had no markers. Workaround: Even add a small cross marker to an empty gmap. However besides that it works really fine. :-) Comments welcome, Best Wishes, Fabian (LionsAd)Comment #82
greenbeans CreditAttribution: greenbeans commented@Fabian: will you marry me?
gmap.views.inc calls template_preprocess_gmap_view_gmap()... so maybe in a preprocess hook? I think newModuleName_preprocess_gmap_views_gmap() could work.
Comment #83
Nigel CunninghamSubscribing.
Here's a patch implementing FabianX's changes from #81. I'm getting empty marker popups though, so might come back soon with a more complete patch.
(Views 6.x-2.10, Gmap dev from 2010-Apr-09).
Regards,
Nigel
Comment #84
Fabianx CreditAttribution: Fabianx commentedHi Nigel,
Thanks for the patch ;-).
For me the marker popups do work. However I had the same problem with wrong marker popups once after upgrading some other system. *sigh*
I installed a clean drupal 6.16, added location-6.x-3.1-RC1, views-6.x-2.10 and gmap-6.x-1.x-dev from 2010-Apr-09.
Then I patched views with the patch and it did work very well for me.
No problem with empty marker popups.
Best Wishes,
Fabian (LionsAd)
Comment #85
Nigel CunninghamHi.
Sorry for not following up on my previous post.
Everything did work - I was just confusing my live site and the test version on my laptop for a bit there.
Thanks for your work!
Nigel
Comment #86
Nigel CunninghamOh, and a link to the live site with working Ajax updates:
http://www.crca.org.au/AboutUs/WhoWeAre/Locations
Comment #87
marcushenningsen CreditAttribution: marcushenningsen commentedBeautiful, this works! Thanks a lot.
I'm changing status, don't know if it's appropriate, and I don't know if this issue should have its project changed since we are now patching views.
Marcus
Comment #88
jdidelet CreditAttribution: jdidelet commentedHi,
Sorry but I tried the patch and it didn't work. Perhaps it's me. I have Drupal 6.16, Views 2.10, Gmap 6.x-1.x-dev (9 April) and Location 6.x-3.x-dev (20 April). If I understood well, the patch modify only views/includes/ajax.inc and ajax_views.js file no? Perhaps I miss something.
I'll try with the new version of GMap, Location (of 29 April) and the last version of Views (30 April). I'll give you my feedback soon.
Comment #89
vangorra CreditAttribution: vangorra commentedThis is fan friggin tastic!
I've patched my source and its working without any issues. When can we see this patch included into views?
Comment #90
vangorra CreditAttribution: vangorra commentedFabianx
This fix is important to the community and should be included as a patch some place. At the very least (in the meantime) be turned into a module. Since you mentioned that you are short on time, I have created a module form of your patch. I intend to give you FULL credit for the solution and look forward to your collaboration in the future.
This module needs review and is awaiting CVS account approval. It can be viewed here:
http://drupal.org/node/804580#comment-2992150
Comment #91
Nigel CunninghamChanging project to views, since that's what we ended up patching.
Comment #92
dawehnerYou cannot mean this as reviewed, its perhaps tested but sorry let's have a look at the patch:
You should not make extra javascript in the base javascript of views. At least this part has to be fixed in the gmap module.
Comment #93
merlinofchaos CreditAttribution: merlinofchaos commentedI'm sorry, I am absolutely not committing GMap specific code to Views. That is 100% against policy.
Comment #94
Nigel CunninghamSorry, MerlinOfChaos, you're absolutely right.
The fix might work perfectly, but that doesn't mean it right. Please accept my apologies for not looking at it again before making the suggested project change.
We need to fix this properly. Switching back to gmap.
Nigel
Comment #95
Fabianx CreditAttribution: Fabianx commentedHi all,
Sorry for the confusion my patch really was only for proof-of-concept purposes.
There is now a custom module for that (as shown above):
http://drupal.org/node/804580#comment-2992150
Thank you vangorra for making a module out of my code! Great solution!
So the BEST solution for this issue for now is:
- Download Tarball from above
- Unpack Tarball
- Enable Module
Perhaps we can now patch gmap (not views!) properly using the code in the module as base.
Best Wishes,
Fabian (LionsAd)
Comment #96
Pix_ CreditAttribution: Pix_ commentedI tried to enable the custom module at #95. It solves the "Javascript is required" issue but no markers are visible after the filter is applied.
Using
- Views 6.x-2.10
- Gmap 6.x-1.1-rc1
- Location 6.x-3.1-rc1
Thanks for the effort you guys are putting into this issue.
edit: just to point that firebug is not showing any kind of javascript error after the filter is applied. The map refresh and show up correctly but without any markers. Re-applying or removing the filter just gives back an empty map
Comment #97
Fabianx CreditAttribution: Fabianx commentedThis is due to the issue that this module still has that there need to be markers from start on. See my original post.
This can be easily workarounded by putting a GMAP as empty text with just one marker.
(Create a macro via GMAP macro creation, then add a filter type which is parsed by GMAP, then add this as empty text with the input type set to your new input type).
Or just use the following PHP Code as empty text and set the id in your gmap settings and below as :
for example: mygmap-id
Best Wishes,
Fabian (LionsAd)
Comment #98
Pix_ CreditAttribution: Pix_ commentedI'm sorry Fabianx but i'm missing something obviously.
I tried to make a page-display view, style gmap, with a taxonomy filter exposed. I'm starting with a map that shows all my results. Whithout your module enabled if i try to apply the filter, "Javascript is required..." pops up. Ok.
Enabling your module solve this but gives me back an empty map.
To avoid that, as you suggest, i tried to paste that php code inside the empty text space in my page-display views. The result is the same empty map.
I tried also pasting inside the empty text area this macro i created
with a new "GMAP" input type and "GMap macro expander" filter enabled. Im having the same empty map back...
Is there maybe something wrong with my macro?
Comment #99
Bartezz CreditAttribution: Bartezz commentedAt #97, did you see this: http://drupal.org/node/315236#comment-2000766
Cheers
Comment #100
Pix_ CreditAttribution: Pix_ commentedYes i saw that but i dont start with an empty map. i see gmap_markers.js and markerloader_static.js loaded into head....
Comment #101
Pix_ CreditAttribution: Pix_ commentedI decided to start from scratch again
Looks like i didnt need #95 module at all. Everything is working fine by just applying #40 (fix 1)
i will further test to see if there is something wrong but now eveything looks fine. The filter are applied correctly (taxonomy and node title) and the map refresh using ajax...
Comment #102
mindbat CreditAttribution: mindbat commentedI'm using Views 6.x-2.10 and GMap 6.x-1.1-rc1. After I apply the patch in #40, submitting the filters works (thanks, PaulHruska!) but only the first time I submit the filters. When I try to filter the map a second time, I get the "Javascript is required to view this map" error.
Does anyone have a fix for this bug that doesn't require patching the Views module?
Comment #103
Fabianx CreditAttribution: Fabianx commentedSmall fix for the module:
else it'll break on views when there is no gmap.
I think module works best with the -dev versions.
Best Wishes,
Fabian
Comment #104
jcmarco CreditAttribution: jcmarco commentedI have integrated the existing patch with the gmap module, and added some code style cleanup.
Now only load the js file and the callback if the view is a gmap style and has ajax active, this way
we avoid conflicts and extra code in the rest of views.
This patch allows gmap views with exposed filters to AJAX update the gmap view (with even attached tables). You just need to activate the Use AJAX in the view settings.
Thanks to @fabianx for this patch
Comment #105
sreynen CreditAttribution: sreynen commentedWhen using a display based on the default, $view->display_handler->options['style_plugin'] is not set, so the JS doesn't get added. I worked around this by overriding the default on the display handler and everything worked great after that.
Comment #106
jcmarco CreditAttribution: jcmarco commentedI have tested it with a default display (using the preview from the views UI and creating a quicktab with a default view) and I get that style plugin variable always.
Test it yourselft adding after the function definition, a dpm and you will see that variable.
function gmap_views_pre_view(&$view, $display_id, &$view_args) {
dpm($view->display_handler->options);
Please test it again a give us more accurate information to reproduce the problem.
BTW, if you are using a quictab or loading the map in AJAX, then if you get the error that you need the javascript is because the gmap javascript hasen't been loaded before.
But if you check with firebug the DOM you will see that the js with the ajaxFixMap function exists and it should be executed by the ajax view functions.
Comment #107
sreynen CreditAttribution: sreynen commented@jcmarco, that's exactly what I did, dpm($view->display_handler->options), and there's no ['style_plugin'] value there. There is, instead, a ['defaults']['style_plugin'] set to TRUE, suggesting the value should be pulled from the default display, which makes sense to me (DRY). Steps to reproduce (which I think you misread last time as actually viewing the default display):
1) Create a view with default display style set to "gmap"
2) Create a 2nd display, using the default display's style with no override
3) Turn AJAX on that second display, with exposed filters
4) View that second display and try to update the filters with AJAX
Result: error.
Changing step 2 to override (but still keeping the "gmap" style) makes the ['style_plugin'] value show up, because that gives the 2nd display it's own distinct style_plugin value rather than referencing the default display's. It looks like maybe you need to pull the default display style from $view->display['default'] when another display is using the default.
Comment #108
jcmarco CreditAttribution: jcmarco commentedThank you sreynen, for your review and explanation now I catch the problem.
You are right. The problem with the pre_view hook is that there is no information about the display to show only about the whole view.
So I swap to the pre_render where only the display to show is executed and I do the same, checking that js is only loaded once.
Test it again.
Comment #109
jcmarco CreditAttribution: jcmarco commentedI forgot a debugging line in the last patch , please use this one.
Comment #110
jcmarco CreditAttribution: jcmarco commentedI found some js domain definition conflicts. (with IE there were problems loading the rest of javascript and in firebug you have an error)
Instead extending drupal.gmap (that sometimes is not defined) I create this time its own js domain.
Comment #111
EvanDonovan CreditAttribution: EvanDonovan commentedSubscribing to come back to later.
Could this solution be generalized further, or would that be out of scope? I just ran into the same issue when loading Gmaps in a Quicktabs block.
I will try to test this patch if someone outlines the steps involved in a successful test.
Comment #112
jcmarco CreditAttribution: jcmarco commentedThe problem with reloading gmap when using quicktabs or jquery tabs is rather different to this issue.
I solved it adding my own js script that reload the gmap when the new tab is shown,
and it will depend of js events from quicktabs or jquery ui tabs that your bind with the gmap refresh action.
To test this patch:
- create a new view with a gmap style display ,
- add some fields to show location of nodes/users
- set Use Ajax
- Add a filter and expose it.
Now you have a gmap with different nodes, and when you change the exposed filter
if you don't have the patch, all the page is reloaded, with the patch only the gmap is reloaded in ajax,
even if you have attached views to the same display all the attachments are updated together. I use it
to show nodes by postal code with a list of sites. If you change the Postal Code and distance then you
have gmap with the nodes on this area and a list of items on this area.
Comment #113
marcushenningsen CreditAttribution: marcushenningsen commentedI've tried to apply your patch, but I don't see any change. It's possible that I've misunderstood something.
My use case is this: A view with a table of nodes + an attachment with gmap + a number of exposed filters. On page load the table and the map is shown, but when applying a filter the table is updated but I get the "Javascript is required to view this map" message.
Am I doing something wrong, overlooking something? Do you need some extra info?
Marcus
Comment #114
jcmarco CreditAttribution: jcmarco commented@marcushenningsen Did you set the Use AJAX in all your displays?
Comment #115
marcushenningsen CreditAttribution: marcushenningsen commented@jcmarco Yes. Should it work with gmap in an attachment?
Comment #116
frankspin CreditAttribution: frankspin commentedI still have this problem. I use the gmap_ajax_views_4.patch .
In firefox everything is working fine, but in safari i get the message: "Javascript is required to view this map."
Comment #117
jcmarco CreditAttribution: jcmarco commented@frankspin: How is it possible that I have it working with IE7, Firefox 3.6, Safari 5.0 and Chrome 5.0?
If you don't provide more information, I can't do anything.
@marcushenningsen:
I have it working with a display style gmap, even working with a table attached to that display.
If you have as a main display anything else than a gmap display then the ajax callback is not attached.
So create a GMap style view with an attachment as you can swap the visualization order at the end is the same.
And remember to activate the Ajax in both displays, and link the ajax and the exposed form to the attachment.
To have the ajax working is needed to attach a js callback to the function that have been loaded in the
gmap_views_ajax.js and that only happen with gmap style displays with the ajax on views.
Comment #118
marcushenningsen CreditAttribution: marcushenningsen commentedThanks for the help, it works with the table attached to the gmap instead of the other way around.
Comment #119
jdidelet CreditAttribution: jdidelet commentedI tried in the both (gmap in attachment of my table display or table in attachment of my gmap display) and it didn't work. With the last version of gmap (of 11 july 2010) and with Ajax enable on the both views... And with the patch 4 (clear all caches of course). ??? Don't really understand.
Comment #120
yannickooI've table display in my attachment and gmap is default. and the path doesn't seem to work ;(
What can I do now?
Comment #121
yannickooOh you've to pay money for see the install instruductions: http://shop.drupella.com/
I bought it for $12 and I'll get a new module, it's called ajax_gmap.
Hold on ;)
Comment #122
dawehner@yan_nick
The module itself is under the GPL, so you have the freedom to publish it here.
The rest of the module might be under a different license which is not allowed to publish here
Comment #123
yannickooYes it's under the GPL and will publish it here.
Comment #124
yannickooHey guys, I bought it 2 times but PayPal can't get my money. It's very bizarre.
Can you try to buy the ajax_gmap?
Comment #125
khosman CreditAttribution: khosman commentedsubscribing
Comment #126
Anonymous (not verified) CreditAttribution: Anonymous commented*Sorry if this sounds muddled. Been a long day (elections in Kenya) and I am worn out but if I don't post it now, I will forget by the time I wake up*
I don't know if this helps you guys but throwing it in cause it helped me.
Modules in use. All Version 6 stable releases, but this might be irrelevant cause I sort of reproduced it across different versions (mixes) except a Vanilla build..
CCK
GMAP
Panels
Views
My plan was to be able to have a node with CCK fields and the CCK fields would appear in the marker bubble thingy. I am even able to execute html quite well. However, last night, one of my editors put up some content and it occurred to me that one of the non alphanumeric characters in any of the CCK fields would cause it to trip. I suspect node title or a text field (both html and non-html). I am yet to figure out which character tripped it cause she used just about every character but the maps would not load. After filtering out nodes with special characters it started running again. I went through each and every node (and they were many) and the only thing that caught my eye was that in Node Title there were non-alphanumeric characters. All the other fields were working just fine. They were too many to change, hence I filtered out the ones with the characters and voila.
Just an FYI: Oh, and there is a funny bug with views/Gmap that fails to recognise if a node is published or not. It publishes everything. On my live, the Publish Node filter was not working. This is important if you are experiencing the problem I had and unpublishing is one of your resolution. My solution was to simply filter out by Post Date. Yet to determine if the bug is views, or gmap and yet to reproduce in Vanilla so this is just a FYI.
Hope it helps.
Later boys and girls.
Kahenya
Comment #127
yannickooHey guys,
I can't order the ajax_gmap module. PayPal doesn't like me ;(
yannnick
Comment #128
tharin2002 CreditAttribution: tharin2002 commentedsubscribing
Comment #129
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedI had a specific issue of errors when I had a gmap in a panel page. It ended up being a javascript error caused by ctools.
the solution for me is here: http://drupal.org/node/888254
Comment #131
yannickooComment #132
jcmarco CreditAttribution: jcmarco commentedWhy do you set this as fixed?
You solved your problem with your third party module,
but not with the ajax views issue, we are trying to add ajax views to the gmap module and not "buy" a module.
Comment #133
Bartezz CreditAttribution: Bartezz commentedToday I updated views, location and the gmap module to the latest releases and unfortunately everything stopped working. Looking into the gmap module files I noticed that the patches in #41 and #47 never made it in. That sucks to be completely honest! People worked hard on those, other people tested them and then they're not making it into the module :(
Does anyone have a working site with the 6.x-1.1 module version updating via AJAX and Views (6.x-2.7 or higher)?
Cheers
Comment #134
sreynen CreditAttribution: sreynen commentedThat implies the testing was successful, but it wasn't. According to #65 and #70, those patches don't work on the current dev version.
Comment #135
Bartezz CreditAttribution: Bartezz commented@sreynen
They did work for the current version at that time
That implies that the dev has been updated without applying the patches. Somewhere along the line the JS changed to drupal_add_js while before this was returned as inline code in $o. Also look at the comment #67 in reply to #65 and the ones above stating that is does work. In fact it works so well I have a live site with over 6.000 daily visitors working with the patches in #41 and #47 running since December of last year without problems! -> http://www.zoetermeergezond.nl
Cheers
Comment #136
vishun CreditAttribution: vishun commented#110 works beautifully...
jcmarco++
Comment #137
joelstein CreditAttribution: joelstein commented#110 works great for me, too.
Comment #138
sreynen CreditAttribution: sreynen commented@Bartezz It looks like dev was updated several months ago, when the status was still "needs review." It's a pretty common situation for a patch in "needs review" status to be made invalid by unrelated changes in dev. Sometimes that even happens to patches in RTBC status.
Often in this situation, the patch is updated to work with the new changes. That's exactly what was suggested in #67, "Seems like we just need an updated patch to take into account the changes in the current dev version." Unfortunately no one actually did that, so the patch died. Next time, if you really want to see your patch get committed, you should follow it through the whole process. It's great that you got the problem solved on your own site, but that's not generally the end of the process for getting code committed.
If that's as far as you care to go, that's still really helpful. I just hope you won't be surprised when the same thing happens again, as it's pretty much how contributing works on Drupal.org in general.
Comment #139
jcmarco CreditAttribution: jcmarco commentedI have checked the #110 patch with last day committed changes and it is still valid.
I agree with sreynen, I have been releasing patches for this issue fixing any issue commented for the few people that have tested it.
It seems that most of the times the people only remember checking the issue queue and help with patches when they have to present a
project or get paid for some work.
That is about community and not about free riders.
By the way patches are always for the last dev release.
Comment #140
Bartezz CreditAttribution: Bartezz commented@sreyen: As far as I can remember the patches I provided were against latest dev at the time though, not 100% sure
@jcmarco: I know what you are saying, but there's only so much time I can stick in the issues I'm involved in. Not sure who your comments were aimed at but I have been checking back and replying since I released that website in dec of last year. But if I recall correctly there wasn't much activity on the maintainer's side. Leaving me thinking my efforts were in vain so I stopped working on it actively. Good to see you've picked up on where some of us left of. I will try your patches asap but am over my head in different projects so it's not likely I will be able to provide feedback soon, sorry.
Cheers
Comment #141
rooby CreditAttribution: rooby commented- Changing the title because it also happens with other amounts of exposed filters.
Note: I'm reviewing the patch in #110.
Looks pretty good and fixes the problem for me too.
However I have one question, primarily aimed at merlinofchaos or dereine if hopefully they are still monitoring this issue at all.
In this part, where we have to add the js settings back in, shouldn't this be done in views because it is something that affects other modules that want to use their own js along side views ajax, not just gmap?
When using ajax, views should load everything in as drupal normally does right?
I have seen a few other modules that have js that breaks when using views with ajax turned on.
Also, the second parameter $views is a bit confusing as it isn't actual views but the text 'views' that gets passed in.
I couldn't find any doco on that hook but at a guess I would think it refers to the module doing the calling and might be better called $module or something? Although I might be way off.
Powered by Dreditor.
Comment #142
morbiD CreditAttribution: morbiD commentedThe patch in #110 works nicely for me too. I've tried it with 6.x-1.1 and 6.x-1.x-dev and have seen no issues so far.
Comment #143
bdragon CreditAttribution: bdragon commented@rooby:
I have no complaints about the ajax_data_alter implementation.
I'm fine with this patch going in if it seems to work properly, as it doesn't touch any of the really fiddly bits in gmap, so is relatively low impact.
Comment #144
stinsoninc CreditAttribution: stinsoninc commentedHello,
I am a relative newbie, so sorry if I don't follow certain conventions.
I have been following this thread with great interest because this is exactly what I'm trying to do.
I applied patch #110 I got , but now getting the following error:
"warning: Parameter 3 to gmap_ajax_data_alter() expected to be a reference, value given in /Applications/MAMP/htdocs/drupal-6.19/includes/common.inc on line 2883."
I'm running core 6.19 and gmap 6.x-1.x-dev.
Do I need to upgrade or patch my core also?
Thank you
Comment #145
morbiD CreditAttribution: morbiD commentedI actually got the same error message as #144 when I tried the patch on a local copy of a site, but when I patched the live site it worked fine, so I assumed my local copy was just borked from other things I'd been testing.
It's currently working great for me on the live site, but if someone else has seen that error it makes me wonder what caused it.
Comment #146
stinsoninc CreditAttribution: stinsoninc commentedThanks morbiD for confirming that I'm not going crazy.
There must be something about your (and my) localhost environment. I can't imagine that it's just because it's on localhost, but it probably has something to do with the particular combination of module versions that are causing the patch to either work or not.
On my localhost I'm running:
gmap 6.x-1.x-dev
location 6.x-3.1
views 6.x-3.x-dev
I suspect that views 6.x-3.x-dev may be the culprit. I am going to (with much effort) revert back to views 6.x.2.11 and see if that works.
Do you have any insight on this version idea? Are you running different module versions on your 2 environments?
Cheers
Comment #147
morbiD CreditAttribution: morbiD commentedThis is definitely some sort of problem with our localhost config. I have just moved a full backup of my working live site into my local server and it immediately produced the error. I'm running Views 6.x-2.11.
What about a PHP version issue? My live site is on PHP 5.2.10 while my local server is on 5.3.3, and doing some googling around Drupal and PHP 5.3, I see other modules have had similar issues regarding passing-by-reference.
Comment #148
rooby CreditAttribution: rooby commented@bdragon,
No worries, I'll investigate the issues in #144 - #147and then go ahead with the patch as it works for my testing and is definitely needed.
I'll look at it tonight.
I might see about making a views issue at some point to see if at least some of this issue is fixable at the views level.
Comment #149
rooby CreditAttribution: rooby commentedCommitted with some minor coding standards fixes.
I also fixed the php 5.3 problem reported in #144
http://drupal.org/cvs?commit=446316
Comment #150
Fabianx CreditAttribution: Fabianx commentedThis rocks! Thanks for applying!
Best Wishes,
Fabian (LionsAd)
Comment #151
griff4405 CreditAttribution: griff4405 commentedFirst, great module, i have been using it for awhile.
I'm still getting the "Javascript is required to view this map."
simple map. just a macro pasted in the body.
-new install of Drupal 6.19
-gmap-6.x-1.x-dev
-php 5.2.14
-jQuery UI 1.6
-views-6.x-2.11
I do not have the location module installed.
Thank you
Comment #152
yannickooLoad your scripts in the header, not in the footer (see page.tpl.php)
Yannick
Comment #153
griff4405 CreditAttribution: griff4405 commentedYannick thanks for the reply.
I looked at my page.tpl.php and my
print $scripts;
is in the head.
still no map display. just getting Javascript is required to view this map.
Comment #155
Alex Andrascu CreditAttribution: Alex Andrascu commentedI was getting this issue also with jQuery 1.3.2 (manually updated) / jQuery UI 1.7.x
Found out that in my case it was Better Select 6.x-1.0-beta2 causing it.
Caught this under firebug console
Disabled BetterSelect and i got gmap back
Hope it helps someone.
Alex
Comment #156
Alex Andrascu CreditAttribution: Alex Andrascu commentedsetting back the switches...my mistake.
Comment #157
mchoffa CreditAttribution: mchoffa commentedmodule fix in #90 worked like a charm. Gmap 6.x-1.1, Views 6.x-2.12, using a gmap page view with exposed filters and a list view attachment
Comment #158
youngelpaso CreditAttribution: youngelpaso commented#110 patched work great for me so far. Thanks again! Having AJAX is pretty much key to my whole mapping application! Cheers!
Comment #159
donquixote CreditAttribution: donquixote commentedAny chance for a new release with this commit included?
Comment #160
carole CreditAttribution: carole commentedSubscribe
Comment #161
nedjoThis error shows up in the Drupal 7 version of the module. It looks like the patch was applied to D6 but not to D7.
Comment #162
nedjoComment #163
alejandrovk CreditAttribution: alejandrovk commented'm having the same issue, some debugging leads me to this message:
Uncaught exception: TypeError: '$.cookie' is not a function
Error thrown at line 167, column 2 in ()
Anyone had the same issues?
Regards,
Alex
Comment #164
dgastudio CreditAttribution: dgastudio commentedsubscribing for d7 port of the patch/module
Comment #165
alejandrovk CreditAttribution: alejandrovk commentedWhere do I suscribe for that kervi??
Comment #166
dgastudio CreditAttribution: dgastudio commentedsorry, my fault. I mean "subscribing".
Comment #167
dafederTrying to get this working as well...
Comment #168
dafederNow that there is an AJAX alter function in views again, we should be able to do something here. See http://drupal.org/node/1220498
Comment #169
Itmman CreditAttribution: Itmman commentedI had this problem, founding no solution.Then, without any reason it has became to work.
Today the same problem "Javascript required.."
I see that this problem appears when I'm offline, when a connect to internet the map works.
HAve you seen that the problem disapper when you are online and it appears offline?
Comment #170
SocialNicheGuru CreditAttribution: SocialNicheGuru commented@169 yes.
when I was not connected to the internet, my page took a long time to load, then I got the javascript error.
Comment #171
nkschaefer CreditAttribution: nkschaefer commentedPatch attached for GMap 7.x-dev. Note that, because hook_views_ajax_data_alter() was originally removed from the Drupal 7 version of Views, this patch requires that you are using the 7.x-dev version of Views, not the older one.
I based my patch on the one in #110 - but I tried to sort-of use the Drupal 7 AJAX "command" API in mine. Unfortunately, none of the existing commands could handle what needs to be done - so I created a new command - Drupal.ajax.prototype.commands.gmapAjaxViewsFix - that does the work.
Thanks,
Nathan
Comment #172
nkschaefer CreditAttribution: nkschaefer commentedAgh. Minor change - forgot to acknowledge that, in the D7 version of GMap, the Views plugin name can be either 'gmap' or 'gmapextended' - changed the if statement on line 1323. Please use this patch instead.
Comment #173
stopshinal CreditAttribution: stopshinal commentedsubscribing
Comment #174
dgastudio CreditAttribution: dgastudio commentedi have applied patch from #172 to the last dev.
but still with the error "Javascript is required to view this map."
example: http://dev.yogalife.by/gmap
Comment #175
nkschaefer CreditAttribution: nkschaefer commentedI just looked at your page - for one, when I click "Apply," the page is refreshing - so it's not using AJAX to reload the map. Maybe you need to set a permission so anonymous users can test that out using AJAX?
Second, I looked at the Javascript files on that page - and the file "gmap_views_ajax.js" wasn't one of them. Can you look in the module's directory to make sure that file was added? It should be in gmap/js/gmap_views_ajax.js. If that file doesn't exist, then you may not have applied the patch correctly - that's the file that does the work.
Thanks,
Nathan
Comment #176
dgastudio CreditAttribution: dgastudio commentedyes, u are right, i have disabled ajax funcionality for test.
now i'm testing again and as u say, gmap_views_ajax.js is not found. so i recheck the patch and i have found the problem.
look, my steps to apply the patch:
ssh
wget http://drupal.org/files/issues/gmap_ajax_views_d7_172.patch
patch < gmap_ajax_views_d7_172.patch
the patch is applied correctly but the file gmap_views_ajax.js was created in /sites/all/modules/gmap folder and not in sites/all/modules/gmap/js as is must be.
i have movied the file to correct folder and now everthing seems working fine.
thank u and sorry for my english.
Comment #177
dgastudio CreditAttribution: dgastudio commentedand, after apply the patch and submit the views form,the options in exposed filter are changed to 1,1,1,1:
open, http://dev.yogalife.by/gmap
click apply.
as i can see, this bug is produced by js.
Comment #178
scotwith1tIn case someone stumbles upon this as I did, I used the module file @ #90 (for D6 gmap) and my superfish menus were broken from then on (not rendering sfHover class, but #103 fixed that. Thanks all!
Comment #179
nkschaefer CreditAttribution: nkschaefer commentedHave any other Drupal 7 users gotten a chance to look at the patch in #172? As far as I know, it should work (and put the Javascript file in the right place) if you apply the patch using "git apply."
Comment #180
avner CreditAttribution: avner commentedi tested it on d7 with no success,
am still getting the same error once applying the filter.
js function is not invoked at all.
started debugging and noticed the gmap_views_ajax_data_alter hook in not invoked as well
when searching for the hook in the views i found several related issues,
and that there was a commit yesterday
i upgraded the views to the latest (dated 2011-Oct-17) and now the ajax works fine!
btw,
the JS file was created in the right location:
thanks!
Comment #181
avner CreditAttribution: avner commentedComment #182
Steven.Pescador CreditAttribution: Steven.Pescador commentedWorked perfect for me using the latest D7 dev versions. Thanks nkschaefer!
Comment #183
firebus CreditAttribution: firebus commentedHere's the patch for rooby's commit in #149 (I need this for a drush makefile, but maybe it will be useful for others too)
Comment #184
brandy.brown CreditAttribution: brandy.brown commentedI applied the patch in #172, but it is still not working with me. My page doesn't reload so I know that it is actually using AJAX. When I look at the source, it is calling the correct js file. Unfortunately I can't link you to my page because it's not available to the public ... any thoughts?
EDIT
-------
I now see that my views isn't working with ajax on anywhere so, I'm going to fix that problem and then come back and try this patch again.
Comment #185
dgastudio CreditAttribution: dgastudio commentedu can check http://drupal.org/project/getlocations module.
Some features
- google maps api v3
- ajax working fine
Comment #186
brandy.brown CreditAttribution: brandy.brown commentedOk I finally fixed my views ajax problem, applied the patch in #172 again and BAM it worked. YAY! Thanks!!
Comment #187
dimon00 CreditAttribution: dimon00 commentedajax+path=working (I had to disable and re-enable the gmap module).
But on IE9 the map is loaded twice: the first time I see the spain (which disappear immediatly) then the map is reloaded zooming on the right area (where I have my markers).
With chrome and firefox the map is loaded only once: on spain! I don't get the area with my markers. :(
Comment #188
Fabianx CreditAttribution: Fabianx commentedAs original patch author of this approach, I tested this again briefly with a recent version of Views and it is working fine.
Please use Dev Versions of Views _and_ GMAP, get it working, then you can try a lower version.
Why it is needed:
When a view is reloaded via AJAX, the Map JS settings were not updated.
All this patch does is to add another behavior to the View in question to save the JS code (this was btw. the standard for other AHAH modules) and transfer this JS code together with the updated view to the client via AJAX.
The View is also changed to call another function after the AJAX has been received. The settings are updated and the maps that are affected reloaded.
Please apply.
Best Wishes,
Fabian
Comment #189
olofbokedal CreditAttribution: olofbokedal commentedThis isn't working for me. I'm using the latest dev versions of GMap and Views, and applied the patch at #172. I've verified that the new JS file is loaded.
At some point, the map reloaded as it should, but the filter wasn't applied. But now, for some reason, that map disappears.
This is the steps I took.
Comment #190
brandy.brown CreditAttribution: brandy.brown commentedhave you verified that exposed filters is working for you ... in any view?
Comment #191
olofbokedal CreditAttribution: olofbokedal commentedYes. The exact same view works as intended if I change the display to an unformatted list.
Comment #192
dimon00 CreditAttribution: dimon00 commentedI'm testing with the last views dev version (drupal 7.9).
I applyed the patch to gmap.
The gmap_views_ajax.js is loaded
But still I get:
Javascript is required to view this map.
I'm using gmap extended.
Ideas?
Comment #193
sco_tt CreditAttribution: sco_tt commentedI was able to make this work in Drupal 7:
I updated Views to dev, disabled GMAP, used the patch in #172, moved the gmap_views_ajax.js to the gmap/js folder, re-enabled gmap and presto.
Unfortunately, I had already put some custom javascript in the header of my page (see http://drupal.org/node/150939) to center the map and autosubmit lat/long values to another an exposed view listing nodes.
The code is:
Now, when I load the view initially, the map centers and zooms using the JS above. When use the exposed filters, it correctly filters the nodes on the map, but the map reverts to it's default zoom and center.
I know there's a conflict betwen the code above and the gmap_views_ajax.js file, but I'm not good enought at JS to figure it out. Any clues?
Comment #194
penyaskitoPatch from #315236-183: GMap View, Exposed Filters and the error "Javascript is required to view this map" upon AJAX update fixed the issue for me. Thanks everybody :)
Comment #195
albech CreditAttribution: albech commentedApplied the patch, moved the gmap_views_ajax.js to js/, but it appears not to load gmap_views_ajax.js.
AJAX enabled in the view.
Tried with all different formats from 'Unformatted list' to the different GMap formats.
In gmap.module I see:
drupal_add_js(drupal_get_path('module', 'gmap') . '/js/gmap_views_ajax.js', array('group' => JS_DEFAULT));
So I believe it was patched correctly.
Needless to say I am still getting: Javascript is required to view this map.
Comment #196
penyaskito#315236-196: GMap View, Exposed Filters and the error "Javascript is required to view this map" upon AJAX update @albech Have you tried to clear cache?
Comment #197
berenddeboer CreditAttribution: berenddeboer commentedSame problem here. Applied #172, cleared cache, cleared views cache just to be sure, nothing helped.
Using views 3.1, gmap dev latest.
Comment #198
berenddeboer CreditAttribution: berenddeboer commentedSome more: I'm actually using an attachment to display the map, so the map is not part of the main view. It appears that gmap_views_ajax_data_alter() is only called with a plug_name == "default", so the attachment isn't processed here?
Comment #199
berenddeboer CreditAttribution: berenddeboer commentedJust commenting out these lines in gmap_views_ajax_data_alter() makes it work.
I'll roll another patch tomorrow which scans attachments properly.
Comment #200
berenddeboer CreditAttribution: berenddeboer commentedHere the patch for D7 so gmap ajax updates also work when gmap is an attachment.
Comment #201
berenddeboer CreditAttribution: berenddeboer commentedOops, left a console.log in my patch, here an attempt to remove that.
Comment #202
Kleve CreditAttribution: Kleve commentedThe patch does not work for me. Anyone else having problem with it?Experiencing the same problem as the initial issue, filter gmap view when using AJAX. Using Drupal 7.12 and gmap 7.x-1.0-dev.For some magic reason the patch started to work after a while and now everything works as it should. You might think clearing the cache made it work, but this time it was not. Maybe some views or settings needed to be updated. Anyway, everything works great now.
Comment #203
Kleve CreditAttribution: Kleve commentedPatch doesn´t seem to work in IE.
Anyone experiencing the same problem?
Comment #204
Krents CreditAttribution: Krents commentedpatch #201 work for me..... Thanks, life saver
Comment #205
Macronomicus CreditAttribution: Macronomicus commentedWow... #185 was the perfect solution, it works great!
Perhaps http://drupal.org/project/getlocations module is the gmap replacement at this point?
Comment #206
pepon_76-1 CreditAttribution: pepon_76-1 commentedPatch #200 Works for me, :-) Thanks a lot !!!!
Comment #207
haiiro.shimeji CreditAttribution: haiiro.shimeji commented#200 works for me, but there is a little matter that the center position and zoom is reset after ajax-reloading.
I wonder it is not necessary to re-setup the map after receive the ajax response, but clear markers and draw new ones.
I have a patch this solves the problem.
Comment #208
haiiro.shimeji CreditAttribution: haiiro.shimeji commentedSorry, I have mistakes to make the patch..
Comment #209
axgalloway CreditAttribution: axgalloway commentedTip for everyone just starting to use Gmap and discovering the issue:
-Install Patch
-Clear Cache
-Delete Browsing History and Temporary Internet Files
-Ta-Da!
Comment #210
merch CreditAttribution: merch commentedUsing Patch #208
I have a block display using a table format with a GMAP attachement display using ajax and exposed filters
Before adding the patch:
Exposed filters would effect the table and the map would display the mesage javascript is required to view this map.
After the Patch:
Map works 100% however the exposed filters are not effecting the results of the table view
Really want to get this working
EDIT: Rolled back and tried patch #201 works so far without problems
Comment #211
axgalloway CreditAttribution: axgalloway commentedYea, I used #201 too.
Comment #212
haiiro.shimeji CreditAttribution: haiiro.shimeji commentedOk, patch #201 is applied to 7.x-1.x branch. Thanks a lot!
Comment #214
Anonymous (not verified) CreditAttribution: Anonymous commented#201 doesn't work for me.
Using 7.x-1.x-dev and have done all the tricks in #209.
I have a block with exposed filters using AJAX. When the page loads the map displays but when you apply a filter you get the "Javascript is required to view this map." error.
S
Comment #215
dharam1987 CreditAttribution: dharam1987 commentedHello,
I am still getting the same error, #201 seems to have been applied, but still Javascript not loaded error is coming for me. This is when I am using a exposed filter and having ajax on. Banging my head, anybody found a fix for this, please let us know here.
Thanks
Comment #216
gnal CreditAttribution: gnal commentedPatch #201 wasn't working for me until I updated views to the latest stable release. If running with an outdated rc version of views the patch won't work (because of http://drupal.org/node/1220498 issue).
Comment #217
podarok#208 needs review
Can anyone test it against latest devs
If all ok - I`ll push it with upcoming beta release
Comment #218
podaroktrailing whitespace
trailing whitespace
trailing whitespace
trailing whitespace
trailing whitespace
trailing whitespace
tabs!!
We should use spaces for tabstops
Comment #219
johnvThis issue is fixed with #201 and committed as reported by haiiro.shimeji in #212
@haiiro.shimeji, your adapted patch in #208 is not committed. You say
If still necessary, can you open a new issue with that matter and a new patch?
Thanks!
Comment #220.0
(not verified) CreditAttribution: commentedUpdated issue summary.
Comment #221
johnnybgoode CreditAttribution: johnnybgoode commentedThis fix should work for both style plugins provided by Gmap, currently it will only work for the 'gmap' style plugin, not 'gmapextended'. Patch against the latest 2.x-dev is attached.
Comment #222
podarokcode style error https://drupal.org/coding-standards#indenting
Comment #223
tanmaykPatch from #221 worked for me.
Comment #225
Fabianx CreditAttribution: Fabianx commentedRTBC! - Still following my very first Drupal patch and it still has activity. After 4 years! :-D
Comment #226
Fabianx CreditAttribution: Fabianx commentedRTBC! - Still following my very first Drupal patch and it still has activity. After 4 years! :-D
Comment #227
yannickooPer #222
Comment #228
podarok#221 commited ))))