You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Clusterer.PopUp = function(cluster){
var clusterer = cluster.clusterer;
var html = '<table width="300">';
var n = 0;
for (var i = 0; i < cluster.markers.length; ++i){
var marker = cluster.markers[i];
if (marker != null){
++n;
var icon_marker = marker.getIcon();
html += '<tr><td>';
html += '<img src="' + icon_marker.url + '" width="' + (icon_marker.size.width / 2) + '" height="' + (icon_marker.size.height / 2) + '">';
If marker.getIcon() returns undefined, the method will blow up like this:
Uncaught TypeError: Cannot read property 'url' of undefined
Btw, I remember having used the clusterer successfully in past projects, and having been happy with it. So something must have changed in the clusterer or in the Drupal module, or my setup is not correct. But even if my setup is not correct, adding some sanity checks can't be wrong.
Thanks!
The text was updated successfully, but these errors were encountered:
Ok, this turned out to be a configuration issue. Somehow there was no marker configured.
But I still think this should be detected earlier with a meaningful message.
If marker.getIcon() returns undefined, the method will blow up like this:
This method fires a cluster is being clicked.
See also Clusterer2.js: marker.getIcon() returns null, and Clusterer.PopUp() blows up. in the drupal.org GMap issue queue.
I expect this is not an either-or, but both the Drupal module and the clusterer should add some sanity checks for early problem detection.
Btw, I remember having used the clusterer successfully in past projects, and having been happy with it. So something must have changed in the clusterer or in the Drupal module, or my setup is not correct. But even if my setup is not correct, adding some sanity checks can't be wrong.
Thanks!
The text was updated successfully, but these errors were encountered: