Closed (fixed)
Project:
Leaflet Markercluster
Version:
7.x-1.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
26 Nov 2013 at 23:26 UTC
Updated:
19 Dec 2015 at 20:57 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
Robin_K commentedI'm having the same problem, no errors are reported but the clustering plugin isn't loaded.
Comment #2
stephen Piscura commentedI'm wondering if this is in any way related to #2148371: On upgrade to 7.x-1.0, all views maps are broken. Applying the latest patch from that thread returned my Leaflet maps, but now with no marker clusters.
Comment #3
stephen Piscura commentedSo it looks like gmclelland's suggestion in #2148371: On upgrade to 7.x-1.0, all views maps are broken is correct: the Leaflet Markercluster module just isn't compatible with the most recent release (and/or more recent dev snapshots) of the Leaflet module.
Comment #4
barryvdh commentedYeah, using the latest version doesn't work. I had to revert to leaflet version 7.x-1.0-beta3+44-dev to get the map back..
Comment #5
danharper commentedI get this error in js console when using latest dev of leaflet, leaflet_more_maps, leaflet_markercluster and ip_geoloc
Cheers Dan
Comment #6
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-1.x-dev (preferred because of minor, unrelated bug fixes)
Leaflet MarkerCluster 7.x-1.x-dev
IP Geolocation Views and Maps 7.x-1.x-dev
Comment #7
rdeboerComment #8
arx-e commentedI am copying this from https://drupal.org/node/2159309 since it is a Markercluster issue
I updated to the latest dev versions and the map is showing now even with clustering enabled but the marker clusters are not showing:
http://test.ecoschools.gr/schools-map
Using:
IPGV&M 7.x-1.23+14-dev (Jan 05)
Leaflet 7.x-1.0+5-dev (Jan 03)
Leaflet More Maps 7.x-1.7+6-dev (Jan 01)
Leaflet Markercluster 7.x-1.0-beta1+5-dev (Jan 05)
leaflet.markercluster.js 0.4.0
Get Locations 7.x-1.10
Comment #9
rdeboer@arx-e,
Your link, http://test.ecoschools.gr/schools-map, works perfectly on my Mac, here in Australia, on Safari and Firefox and Chrome with beautifully "exploding" animated marker clusters that are circular on all three browsers.
It also works on my Android mobile phone, but the markers are square, as they will be on older versions of IE, due to the fact that these browsers don't support rounded corners.
Rik
Comment #10
arx-e commentedYou are right Rik.
It took a Firefox cache clean up for it to work for me too - something was stuck in there...
Thanks again for your help!
Comment #11
danharper commentedFixed for me, thanks very much.
Dan
Comment #12
Pete B commentedSimilarly to #2163973: Leaflet Demo submodule only displays OSM Mapnik after update, the general fix for this would be to implement hook_leaflet_map_prebuild_alter() instead of leaflet_markercluster_preprocess_leaflet_map() which is no longer fired automatically because theme_leaflet_map() has been dropped in leaflet 1.0.
This would require a change to ip_geoloc, which fires this function manually:
views/ip_geoloc_plugin_style_leaflet.inc, line 486
It fixes leaflet_views and the leaflet content widget (and anything else using leaflet_build_map() )
Patch to follow...
Comment #13
Pete B commentedComment #14
DerTobi75 commentedThe patch in #13 works for me! Thanks!
Comment #15
cboyden commentedI ran into this same problem: The status report indicates that the markercluster JS library is installed, but the JS is not added to the page.
My environment:
leaflet 7.x-1.0+8-dev
leaflet_markercluster 7.x-1.0-beta1+5-dev
leaflet_more_maps 7.x-1.7+6-dev
Leaflet.markercluster js 0.4
Leaflet js 0.7.1
(not using IPGV&M in this instance)
The patch in #13 fixed the issue for me as well. However applying this patch will break the map page if you ARE using IPGV&M.
Comment #16
rdeboerOk so I'm realigning all these modules once again.
I've checked in PeteB's patch from #13 for Leaflet MarkerCluster.
Now doing Leaflet More Maps and then IPGV&M.
You should be able to use any or all Leaflet XXX modules with or without IPGV&M if you use the latest 7.x-1.x-dev of all of them.
Comment #17
rdeboerComment #18
marcopbazz commentedI tried patch #13 and upgrade all the modules to the dev version. Markercluster still doesn't work :(
I'm using
Leaflet (and leaflet views) 7.x-1.0+9-dev
Leaflet Markercluster 7.x-1.0-beta1+5-dev
Leaflet More Maps 7.x-1.7+7-dev
Comment #19
rdeboerRe #18:
I don't understand how this gets misunderstood.
So one more time....
DO NOT PATCH ANYTHING! The latest 7.x-1.x-dev of Leaflet, Leaft More Maps, Leaflet MarkerCluster and IP Geolocation Views & Maps (if desired) already have all required patches in them.
Just make sure you use the VERY LATEST (yesterday) 7.x-1.x-dev of all modules involved, refresh caches and then tell me it's not working with a reproducible test case.
Rik
Comment #20
marcopbazz commentedaaaa now I understand!
Revode patch and now it works!
Thank you and sorry for my mistake! :)
Comment #21
rdeboerNo problems. On behalf of everyone following this thread, thank you for confirming it all works without patching!
Comment #22
davidaxelrod commentedI experienced a few initial problems getting started but having finally realised to install the latest 7.x-1.x-dev versions of Leaflet, Leaflet More Maps, Leaflet Marker Cluster and IP Geolocation Views and Maps, I managed to get it all working. It’s worth remembering to flush the caches if you had previously installed the recommended versions.
They are the best map options I can find having reviewed various modules :-)
Comment #24
halloffame commentedMap does not render at all with:
leaflet_markercluster 7.x-1.x-dev (2014-Feb-06)
leaflet 7.x-1.x-dev (2014-Jan-23)
with or without:
ip_geoloc 7.x-1.x-dev (2014-Feb-06)
Nothing on watchdog and but js console says:
Comment #25
klucid commentedSame as #24 here. I've tried using dev releases and recommended releases of all modules to no avail.
Using Leafleat 0.7.2 and Leaflet.markercluster 0.4
An ideas? Thanks in advance for the help!
Comment #26
DerTobi75 commentedI have a similar problem.
When activating Leaflet Markercluster, no Map is shown at all. After deactivating Leaflet Markercluster again, I can see the map with all its markers.
Using the latest Dev Version of both Modules.
Comment #27
gge commentedHello,
I use the following:
I cleared the cache but leaflet.markercluster.js still not loaded.
Status report says
Comment #28
rdeboer@gge:
I don't understand how this can happen.
Any errors in the browser console?
How do you know leaflet.markercluster.js is not loaded?
Using IPGV&M, have you specified a cluster radius on your map view?
Comment #29
gge commentedWell it seems that I did not specified a cluster radius on map that's why when I looked at the source code no leaflet_markercluster script (js or css) was in the header section.
Rik thank you so much!
Comment #30
rdeboerThanks gge,
Consider this fixed, then.
Note that by now you don't have to use the dev versions of any of the modules involved. The official releases have caught up.
Rik
Comment #31
DerTobi75 commentedWell, I still have the Problem, when I activate the Leaflet Markercluster Module, no maps are shown!
I do not need any of IPGV&M's features, so I do not like to install it, if not necessary!
Regards,
Tobi
Comment #32
rdeboer@DetTobi75, #31:
That's fair enough and it should certainly work with or without IPGV&M.
So I disabled IGPV&M on my system.
So I just created a Leaflet Map using the Leaflet Views submodule, part of Leaflet. Clustering works and the map canvas shows, complete with zoom controls.
I use Leaflet 7.x-1.1
Leaflet MarkerCluster 7.x-1.x-dev (as I'm doing some more development on it).
Works with or without Leaflet More Maps (I tried both. Just make sure you save the View after you disable the module as the map you selected may no longer be available).
Rik
Comment #33
DerTobi75 commentedHi,
I do not know, what I did wrong ;-(
When enabling Markercluster I get an empty view at: http://dertobi75.de/fotokarte as soon, as I deactivated the module, the view shows the map.
All Javascripts are loaded fine, ...
Regards,
Tobi
Comment #34
rdeboerHi Tobi,
I don't know what you did wrong either. I looked for Javascript errors in the browser console when visiting http://dertobi75.de/fotokarte and everything seems fine. With the Leaflet and Leaflet MarkerCluster JS loaded and in the correct order.
Do you have other modules whose javascript may interfere? What about this piwik.js... what's that doing?
Rik
Comment #35
perkeI believe I have same issue. After activating leaflet_markercluster module, map is empty (no layers and points).
It also messes my dropdown navigation in main menu.
Error in console:
Using:
Leaflet 7.x-1.1+2-dev
Leaflet views 7.x-1.1+2-dev
Leaflet Markercluster 7.x-1.0+2-dev
Drupal 7.28
Leaflet library 0.7.2 with markercluster library correctly installed
Comment #36
rdeboerOk some more info an a workaround:
I've just tried on a fresh install of Drupal 7.28 and the minimum number of modules enabled (leaflet, entity, views, geophp, ctools, geofield, libraries, leaflet_markercluster) and a minimum of libraries installed (Leaflet JS 0.7.2 and Leaflet_MarkerCluster 0.4).
What I found is again what I reported in #32. These combos works all the time for me:
Leaflet 7.x-1.1 (NOT the dev)
Leaflet Markercluster 7.x-1.0 or 7.x-1.x-dev
If you use Leaflet 7.x-1.x-dev in combination with Leaflet MarkerCluster 7.x-1.x-dev then you get the error that DerTobi75 and perke have reported.
If you then copy leaflet.module from 7.x-1.1 over the top of leaflet.module in Leaflet 7.x-1.x-dev AND clear the cashes everything works again.
So whether the culprit is the file leaflet.module from Leaflet 7.x-1.x-dev or whether it is something in Leaflet MarkerCluster remains to be worked out, but at least we have a working combo.
Rik
NOTE: Leaflet JS 0.7.3 just came out yesterday. It seems to work fine with the above combos too.
Comment #37
perkeThanks Rik, I can confirm that this workaround is working here. Haven't tried with Leaflet JS 0.7.3 though.
Maybe marking this back to active?
Comment #38
rdeboerI have also patched leaflet.module in Leaflet 7.x-1.x-dev, see http://cgit.drupalcode.org/leaflet/commit/?id=6f1b3b9
So you can now use the latest Leaflet 7.x-1.x-dev (25 May 2014) in combination with any version of Leaflet MarkerCluster.
Comment #39
DerTobi75 commentedHi,
sorry for my late reply, was on vacation.
After a few patches I got it working now. And I found out, if I use for the Description Content "node entity" and View Mode "Full Content" the map will not show! But that is ok for me!
Best regards,
Tobi
Comment #40
rdeboer@DerTobi75...
Re: "After a few patches I got it working..."
As described in #36, #37, #38... you don't need to patch anything:
You can now use any of the 4 combinations
Leaflet 1.1 or 1.x-dev (24-May-2014)
with
Leaflet MarkerCluster 1.0 or 1.1 or 1.x-dev (13-May-2014 or later)
As for the "node entity" description in "full content" mode causing the map not to show.... that's probably a separate issue for the Leaflet queue. Unless it only happens when Leaflet MarkerCluster is enabled?
Comment #42
Aldus commentedSorry to reopen, but I still have the problem described above. Using leaflet and leaflet_marketcluster, all latest dev versions as suggested above.
When I enable leaflet marketcluster, my maps (rendered through views - leaflet map) disappear.
If I disable the module, the leaflet maps come back.
If someone has a working configuration, I would be glad to ask them the modules at some version that is currently working
Comment #43
willabby commentedI had same problem. I installed the latest recommended version (not dev) of marker cluster just this week on a site already using leaflet, and my map generated through views disappeared. I checked, and I had the latest recommended version of Leaflet installed as well. I tried installing all modules again on clean site to try to figure out where the problem was, and found in my views configuration for the geocode field, I had under "formatter" chosen Leaflet Map, which worked fine until I enabled Markercluster for some reason. When I set that back to "Well Known Text (WKT)" my map came back, with the beautiful clustering, and all was good.
Comment #44
rdeboerThanks so much willabby!
Closing based on the above.
Comment #45
dawnbuie commentedI'm still having trouble with Leaflet Marker Cluster causing my map to be grey when combined with the latest Leaflet. In this instance I'm not using Views - but I have and it was set correctly as well.
I was using Leaflet Market Cluster 7.x-1.2 then just tried updating to 7.x-1.2+9-dev
I'm using Leaflet 7.x-1.3
In JS console is see:
Uncaught TypeError: L.MarkerClusterGroup is not a function
leaflet_markercluster.drupal.js?nzeqx7:129
Uncaught Error: Set map center and zoom first. leaflet.js?nzeqx7:5
Any suggestions on how to troubleshoot this?
Comment #46
dawnbuie commentedUpdate - I changed my map to basic OSM Mapnik and now I only get this error:
Uncaught TypeError: L.MarkerClusterGroup is not a function leaflet_markercluster.drupal.js?nzeqx7:129
(anonymous function) @ leaflet_markercluster.drupal.js?nzeqx7:129
v.extend.each @ jquery.min.js:2
v.fn.v.each @ jquery.min.js:2
Drupal.behaviors.leaflet.attach @ leaflet_markercluster.drupal.js?nzeqx7:14
(anonymous function) @ drupal.js?nzeqx7:76
v.extend.each @ jquery.min.js:2
Drupal.attachBehaviors @ drupal.js?nzeqx7:74
(anonymous function) @ drupal.js?nzeqx7:481
l @ jquery.min.js:2
c.fireWith @ jquery.min.js:2
v.extend.ready @ jquery.min.js:2
A @ jquery.min.js:2
Comment #47
rdeboerSounds like the Leaflet MarkerCluster JS isn't included.
Comment #48
dawnbuie commentedYes and why would this be happening. It was working on the same site with an earlier version of Leaflet. Have there been any changes in file location or how the markercluster js is called in leaflet?
Here is the test site where I reproduced this bug using updated versions of leafter and marker cluster http://new2.miningwatch.ca.nmsrv.com/content/point-map
Comment #49
rdeboerHave you read Leaflet Markercluster project page?
Which versions are you using?
Comment #50
dawnbuie commentedI was using the Leaflet 1.0 beta 2 with the recommended Leaflet MarkerCluster version (https://github.com/Leaflet/Leaflet.markercluster/tree/leaflet-master)
I was still getting this error:
Uncaught TypeError: Cannot read property 'trim' of undefined.
then found this github thread https://github.com/Leaflet/Leaflet.markercluster/issues/528 which recommended using this version of markercluster http://pastebin.com/3ZjK6LtA
But it still didn't work for me so I simply went back to using the latest leaflet 0.7.7 library, downloadable here http://leafletjs.com/download.html and the /dist/ folder from this https://github.com/Leaflet/Leaflet.markercluster
it works now.
thanks for the replies.
Comment #51
rdeboerOk.