tragomio / google-maps-utility-library-v3

Automatically exported from code.google.com/p/google-maps-utility-library-v3
Apache License 2.0
0 stars 0 forks source link

Sample Request - MarkerCluster.setCalculator .... #145

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hi, any one can help me with a sample of MarkerCluster using the setCalculator 
function?

Thanks a lot!

Original issue reported on code.google.com by dto...@gmail.com on 30 Nov 2011 at 6:47

GoogleCodeExporter commented 8 years ago
Here's the default calculator function from the MarkerClustererPlus source code:

function (markers, numStyles) {
  var index = 0;
  var count = markers.length.toString();

  var dv = count;
  while (dv !== 0) {
    dv = parseInt(dv / 10, 10);
    index++;
  }

  index = Math.min(index, numStyles);
  return {
    text: count,
    index: index
  };
};

Read the MarkerClustererPlus Reference for the specifications of a calculator 
function and how to provide your own.

Original comment by garylitt...@gmail.com on 27 Feb 2012 at 4:30

GoogleCodeExporter commented 8 years ago

Original comment by garylitt...@gmail.com on 16 Mar 2012 at 4:24