1. Create a cluster with a few markers
2. Grab the center of the cluster using cluster.getCenter()
3. Create a regular, non-cluster marker with the position set to that cluster
center
Expected result:
The cluster and the marker should have the same, or very close (rounding errors
due to int parsing) to the same, position
Actual result:
The cluster is positioned lower than the marker by what appears to be half the
height of the cluster style.
ClusterIcon.prototype.getPosFromLatLng_ = function (latlng) {
var pos = this.getProjection().fromLatLngToDivPixel(latlng);
pos.x -= this.anchorIcon_[1];
pos.y -= this.anchorIcon_[0]; <---- Adding *2 resolves the problem. anchorIcon_[0] is not being properly calculated
pos.x = parseInt(pos.x, 10);
pos.y = parseInt(pos.y, 10);
return pos;
};
Original issue reported on code.google.com by Hawbaker...@gmail.com on 22 Aug 2014 at 6:08
Original issue reported on code.google.com by
Hawbaker...@gmail.com
on 22 Aug 2014 at 6:08