I am using markerclusterer_packed.js

I do not see any effect while changing the Max Zoom level. I would have expected this setting to not show clusters and show individual markers above this level.

Does anyone have this effect working?

Comments

waverate’s picture

Bump

brei9000’s picture

I'm also having this issue... anyone solve it?

Paul_Gregory’s picture

Having hit this issue today I see that the problem lies with the values for Grid Size and Max Zoom being stored as strings within the in the gmap_markermanager array in the Variables table. The MarkerClusterer expects these values to be numbers. This is a snippet from the unpacked markerclusterer.js - note the use of typeof XXX === "number":

  if (typeof opt_opts === "object" && opt_opts !== null) {
    if (typeof opt_opts.gridSize === "number" && opt_opts.gridSize > 0) {
      gridSize_ = opt_opts.gridSize;
    }
    if (typeof opt_opts.maxZoom === "number") {
      maxZoom_ = opt_opts.maxZoom;
    }
    if (typeof opt_opts.styles === "object" && opt_opts.styles !== null && opt_opts.styles.length !== 0) {
      styles_ = opt_opts.styles;
    }
  }

However, I'm not entirely sure how to force the value to be stored as an integer.

Paul

marco.abiuso.questar’s picture

As a temporary workaround, you may change the javascript into:

if (typeof opt_opts.maxZoom === "number") {
      maxZoom_ = opt_opts.maxZoom;
} else {
      maxZoom_ = parseInt(opt_opts.maxZoom);
}

The same stands for the gridSize

    if (typeof opt_opts.gridSize === "number" && opt_opts.gridSize > 0) {
      gridSize_ = opt_opts.gridSize;
    } else {
        gridSize_ = parseInt(opt_opts.gridSize);
    }

You'll have to use the unpacked js version, or repack it, of course.

Unfortunately I see simple no way to force the values storing as integer, as admin forms are handled directly by Drupal (there is no code to hack in the module, a part from the admin form itself).

Hope this helps.

dafeder’s picture