Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cluster icon y-pos incorrect #318

Open
GoogleCodeExporter opened this issue Aug 24, 2015 · 1 comment
Open

Cluster icon y-pos incorrect #318

GoogleCodeExporter opened this issue Aug 24, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

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 [email protected] on 22 Aug 2014 at 6:08

@GoogleCodeExporter
Copy link
Author

Nevermind :[ wasn't properly setting AnchorIcon

Original comment by [email protected] on 26 Aug 2014 at 5:06

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant