Hi,

I tried this on two installations right now and I cannot get this to work on leaflet maps using the latest (dev-)version of the leaflet module.

The marker cluster JS and CSS files are not loaded, but they are all in the right please. Status report is green and I also double, triple checked everything.

Best regards,

Tobi

Comments

Robin_K’s picture

I'm having the same problem, no errors are reported but the clustering plugin isn't loaded.

stephen Piscura’s picture

I'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.

stephen Piscura’s picture

So 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.

barryvdh’s picture

Yeah, 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..

danharper’s picture

I get this error in js console when using latest dev of leaflet, leaflet_more_maps, leaflet_markercluster and ip_geoloc

Uncaught TypeError: Cannot read property 'bounds' of undefined leaflet.drupal.js?myu0k7:204
Drupal.leaflet.create_point leaflet.drupal.js?myu0k7:204
leaflet_create_feature leaflet_markercluster.drupal.js?myu0k7:160
(anonymous function) leaflet_markercluster.drupal.js?myu0k7:110
e.extend.each jquery.min.js:2
e.fn.e.each jquery.min.js:2
Drupal.behaviors.leaflet.attach leaflet_markercluster.drupal.js?myu0k7:11
(anonymous function) drupal.js?myu0k7:76
e.extend.each jquery.min.js:2
Drupal.attachBehaviors drupal.js?myu0k7:74
(anonymous function) drupal.js?myu0k7:412
n jquery.min.js:2
o.fireWith jquery.min.js:2
e.extend.ready jquery.min.js:2
c.addEventListener.B

Cheers Dan

rdeboer’s picture

I 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

rdeboer’s picture

Assigned: Unassigned » rdeboer
Status: Active » Fixed
arx-e’s picture

I 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

rdeboer’s picture

@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

arx-e’s picture

You 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!

danharper’s picture

Fixed for me, thanks very much.

Dan

Pete B’s picture

Similarly 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

      if (module_exists('leaflet_markercluster')) {
        $vars = array();
        leaflet_markercluster_preprocess_leaflet_map($vars);
      }

It fixes leaflet_views and the leaflet content widget (and anything else using leaflet_build_map() )

Patch to follow...

Pete B’s picture

Status: Fixed » Needs review
StatusFileSize
new1.03 KB
DerTobi75’s picture

The patch in #13 works for me! Thanks!

cboyden’s picture

Category: Support request » Bug report

I 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.

rdeboer’s picture

Ok 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.

rdeboer’s picture

Status: Needs review » Fixed
marcopbazz’s picture

I 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

rdeboer’s picture

Re #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

marcopbazz’s picture

aaaa now I understand!

Revode patch and now it works!

Thank you and sorry for my mistake! :)

rdeboer’s picture

No problems. On behalf of everyone following this thread, thank you for confirming it all works without patching!

davidaxelrod’s picture

I 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 :-)

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

halloffame’s picture

Status: Closed (fixed) » Active

Map 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:

Consider using 'dppx' units instead of 'dpi', as in CSS 'dpi' means dots-per-CSS-inch, not dots-per-physical-inch, so does not correspond to the actual 'dpi' of a screen. In media query expression: (min-resolution: 144dpi) leaflet.js?n14gr3:6
Consider using 'dppx' units instead of 'dpi', as in CSS 'dpi' means dots-per-CSS-inch, not dots-per-physical-inch, so does not correspond to the actual 'dpi' of a screen. In media query expression: (min-resolution: 144dpi)
klucid’s picture

Same 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!

DerTobi75’s picture

I 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.

gge’s picture

Hello,
I use the following:

IP Geolocation Views & Maps 7.x-1.25
Leaflet 7.x-1.1+2-dev
Leaflet More Maps 7.x-1.9
Leaflet Markercluster 7.x-1.0+1-dev

I cleared the cache but leaflet.markercluster.js still not loaded.

Status report says

Leaflet	0.7.2
The Leaflet Javascript library is installed correctly. 29 maps available.

Leaflet MarkerCluster library	Installed
rdeboer’s picture

@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?

gge’s picture

Well 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!

rdeboer’s picture

Status: Active » Fixed

Thanks 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

DerTobi75’s picture

Well, 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

rdeboer’s picture

@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

DerTobi75’s picture

Hi,

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

rdeboer’s picture

Hi 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

perke’s picture

I 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:

Error: Error: No value provided for variable {s}
Source File: /sites/all/libraries/leaflet/leaflet.js
Line: 6

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

rdeboer’s picture

Ok 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.

perke’s picture

Thanks 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?

rdeboer’s picture

I 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.

DerTobi75’s picture

Hi,

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

rdeboer’s picture

@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?

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

Aldus’s picture

Status: Closed (fixed) » Active

Sorry 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

willabby’s picture

I 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.

rdeboer’s picture

Status: Active » Closed (works as designed)

Thanks so much willabby!

Closing based on the above.

dawnbuie’s picture

Status: Closed (works as designed) » Active

I'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?

dawnbuie’s picture

Update - 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

rdeboer’s picture

Sounds like the Leaflet MarkerCluster JS isn't included.

dawnbuie’s picture

Sounds like the Leaflet MarkerCluster JS isn't included.

Yes 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

rdeboer’s picture

Have you read Leaflet Markercluster project page?
Which versions are you using?

dawnbuie’s picture

I 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.

rdeboer’s picture

Status: Active » Closed (fixed)

Ok.