googlearchive/js-marker-clusterer

Cluster icon location incorrect to most markers

kshipp opened this issue · 3 comments

I've found that the calculation(?) of the location of the cluster icon to be incorrect at times. I've attached two screenshots.
Map1 = you can see 28 locations at the Oklahoma and Arkansas border (which is incorrect). Only ONE location is near there.
Map 2 = shows the zoom when clicking on Map1 ("28" icon). Notice that the Clusterer placed the cluster icon near the Ft. Smith (far left) marker, instead of where it should, either a)..centrally located among all 28 locations, or b)..at the next-largest-cluster (26). Ideally, the cluster icon position needs to be central to all the underlying markers. It looks like it's just choosing a random marker position to represent its location?

Map1 incorrectly shows all the locations too far west Arkansas, whereas 90% of them are exactly central Arkansas.
map1
map2

Set the averageCenter option to true, it is set to false by default. Maybe it should be set to true by default. Other than that this is intended behavior and this issue can be closed.

PeterTheOne - awesome! I'll give that a try. Thanks for sharing this info. I agree - should be defaulted to True.

After adding averageCenter option to true, it works perfectly. Thanks!

map3