googlearchive/js-marker-clusterer

Adding your own calculator, correct method?

Opened this issue · 1 comments

A little confused about overriding the calculator...

should it be as per the example here http://gmaps-utility-library-dev.googlecode.com/svn/trunk/markerclusterer/examples/simple_example_with_values.html

eg passed in as a option on instantiation..
var markerCluster = new MarkerClusterer(map, markers, {'calculator': average});

or using the
markerCluster.setCalculator(function(markers, numStyles) {...});

I couldn't seem to get the example method to work, but assume there might be an overhead setting after instantiation?

Hey!
If it's ok to have calculator globally, you can override function like this:

MarkerClusterer.prototype.calculator_ = function(markers, numStyles) {
...

coffeescript:

MarkerClusterer::calculator_ = (markers, numStyles) ->
...