Although i'm loathe to add another "Can i haz the code cuz itz borken!??!" post to drupal.org, i'm afraid i do need to reach out with a pretty general support request. I've just upgraded to 7.x-1.0 from a dev version (sorry, i can't be entirely sure, but i think it was this snapshot) and now my maps—which are all generated by views—are all displaying no results content.
I've checked to ensure the Leaflet library is in place, that i've run all updates, flushed all caches, ran cron, blah blah. However, nothing seems to bring the maps back into display.
If anyone has any nudges in the right direction, i'd be very grateful. I've attached exports of the views, if it's of any value.
Comments
Comment #1
stephen Piscura commentedComment #2
Sel_Space commentedI have the same issue
Comment #3
gmclelland commentedI have a similar issue. On one of my views the data strangely appears when you uncheck the "Hide Empty" under the Leaf Map Settings in the view.
Maybe it is somehow related to everyone's problem.
Can someone try that and see if that works for you?
Comment #4
gmclelland commentedI think it might be related to this commit http://drupalcode.org/project/leaflet.git/commitdiff/4c30f8d0ea07f89d9d8...
Look at the code at the bottom:
I replaced that with the older version:
Then the map seemed to work again. I'll try to create a patch if other people can confirm that the "Hide Empty" checkbox is causing the problem.
I'm rushing through this post so I might not have studied the code very well, but I think the problem might be somewhere close.
Comment #5
hutch commentedI would suggest
If $data is empty and "hide_empty" is TRUE then return nothing, otherwise return the map
Comment #6
gmclelland commentedHere is a patch based on @hutch's recommendations. Seems to work for me.
Comment #7
stephen Piscura commentedForgive me if these tag changes are incorrect, but i think this qualifies as a serious bug. Thanks to those who are offering insights and solutions.
Comment #8
stephen Piscura commented@gmclelland: Thanks for the patch! It brought my maps back.
Now that they're back, however, my marker clusters are no longer displaying. Possibly related to #2144935: Broken with latest Leaflet Dev Version?
Comment #9
stephen Piscura commentedgmclelland and others,
Is anyone experience a huge performance hit when using the patch? I'm getting a whole lot of this:
Comment #10
gmclelland commented@stephen Piscura - I could be wrong, but I think your other problems are unrelated to this. With the patch in #6 my views are working correctly.
Some things you might check:
How many markers are you loading? - A bunch of markers can cause a frontend performance problem.
Check the web page's source and make sure your javascript is in the markup.
Try testing by making a simple view that uses a leaflet map. Does it work?
Comment #11
gmclelland commentedJust a guess, but when looking at leaflet_markercluster javascript there is a comment that says it is overriding the leaflet js
Try disabling that module and see if the leaflet module now works for you.
My guess is that module hasn't been updated yet with all the new changes in the leaflet module.
Hope that helps
Comment #12
stephen Piscura commentedgmclelland,
Wow, yeah that did it. The map's performance is fine now. So i think you're right, the marker clusters module is just incompatible with the latest version of Leaflet. Many thanks for digging in to find that...
Comment #13
hutch commentedMarkercluster (fresh git clone) works fine with Leaflet.js version 0.7
To get the markercluster plugin to work, you need to group your markers and instead of loading them into a layerGroup,
eg line 46 in current dev leaflet.drupal.js
Markercluster needs to use something like
Of course steps will have to be taken to ensure that only features that are markers (points) are handled this way.
You should also ensure that leaflet.markercluster.js is loaded before leaflet.drupal.js
Comment #14
mondrakeConfirm #11, disabling markercluster map shows fine. With markercluster enabled, browser console throws 'Uncaught TypeError: Cannot read property 'bounds' of undefined' on 'Drupal.leaflet.create_point'.
Comment #15
barryvdh commentedAlso had this problem. I reverted to 7.x-1.0-beta3+44-dev to get the MarkerCluster to work again.
Comment #16
leoklein commentedOy, same nightmare. The older version of Leaflet worked.
Thanks for the tip - #15!
Comment #17
rdeboerI have checked in a number of changes to Leaflet MarkerCluster 7.x-1.x to make it compatible again after the changes made to Leaflet, in particular leaflet.drupal.js.
I've done some brief testing and found that the following combination of module versions seems to work when used together (and probably as a subset).
As of today, none of the versions below require patches
Leaflet 7.x-1.x-dev
Leaflet More Maps 7.x-1.7 or 7.x-1x-dev
Leaflet MarkerCluster 7.x-1.x-dev
IP Geolocation Views and Maps 7.x-1.x-dev
Comment #18
gmclelland commentedHi Rick, I just tested the latest dev and it still doesn't seem to be fixed. I'm not using the Leaflet Marker Cluster module.
I still have to use the patch in #6 https://drupal.org/comment/8241983#comment-8241983 to get it to work correctly.
Just thought I would let you know
Comment #19
rdeboer@gmclelland:
Thanks for mentioning. I don't use the Leaflet Views interface myself, I'm using IPGV&M for that (come and join the dark side, Luke!).
But I have just checked in the patch from #6, so for those wishing to use Leaflet Views, you should be fine now.
Thank you hutch and gmclelland.
Rik
Comment #20
pixelsweatshop commentedSorry, Rik. I hate to revert this issue, but it doesn't seem to be resolved in the latest dev.
Comment #21
rdeboer@nicoz
See #17
You need to use very latest 7.x-1.x-dev of ALL those modules if you use them.
If after refreshing caches it still doesn't work please provide reproducible test case.
Rik
Comment #22
pixelsweatshop commentedI think that is the issue here, Rik. In this situation I am just running the dev version of the leaflet module and leaflet views. I am not using Leaflet More Maps, Leaflet MarkerCluster, and IP Geolocation Views and Maps. IPGV&M is great on some other stuff we are doing but is not needed in this particular case. This may be why you cannot replicate the issue.
However, now that I have setup a dev box to show you the issue, leaflet views maps are now showing. Not sure why they are missing when working locally and fine when I move it up to a public URL.
Either way, Geocoder is now complaining:
Exception: Google API returned bad status.\nStatus: ZERO_RESULTS in geocoder_google() (/sites/all/modules/geocoder/plugins/geocoder_handler/google.inc).#1982688: GeoJSON boundaries fail to render with Geofield 2.x
I am going to have to debug this some more to see if I can isolate the issue and report back.
Comment #23
rdeboer@nicoz
Well all I can say is that everything works for me. With or without Leaflet MarkerCluster. With or without Leaflet More Maps. And with or without IP Geolocation Views and Maps. Provided you use 7.x-1.x-dev versions of all the module you decide to enable.
The only gotcha I found is that after disabling Leaflet More Maps you need to save the Leaflet View again as it was likely set to a map other than the only one supported by Leaflet when operating by itself. If you don't do that you'll see your markers but on a grey background.
Must add that I don't use Geocoder at the moment.
The Geocoder error is interesting. If that's due to an error orginating in javascript, then the browser is likely to have abandoned any further execution and thus the Leaflet JS doesn't get run....
Check your browser console...
Rik
Comment #24
gcbComment #25
pixelsweatshop commentedThat's good to know. There must be something in this particular setup that is causing this. I have never had these issues before and I have built a ton of other mapping projects with these modules.
No errors there, nor in dblog.
I haven't changed a thing since my last post on the 17th and geocoder is no longer complaining about Exception:
Google API returned bad status.\nStatus: ZERO_RESULTS in geocoder_google() (/sites/all/modules/geocoder/plugins/geocoder_handler/google.inc).It must have been a temp API issue on their end. Either way, this part is beyond the scope of this thread.
It also appears that there is a 0.7.2 release of the library on the 17th as well. Not sure if #2152423: Leaflet Library 0.7.1: The version of the Leaflet library could not be detected which fixed support for 0.7.1 is related to this one then.
Too many moving parts on this one for me to properly trace the issue easily. I'll keep poking at it and report back. We can keep this as "Postponed (maintainer needs more info)" until I have something for you or someone else can chime in if they are still experiencing it.
p.s. As always, thanks for your time, Rik. You are a gentleman and a scholar. :)
Comment #26
rdeboer@nicoz
Thank you for your kind words.
Look forward to any findings you wish to share with us, Nico!
Rik