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

Fix anchoring for custom markers on Settings page #738

Merged
merged 1 commit into from
Nov 1, 2019
Merged

Fix anchoring for custom markers on Settings page #738

merged 1 commit into from
Nov 1, 2019

Conversation

NimaBoscarino
Copy link
Contributor

Previous Behaviour

The custom icons float around when the zoom level changes, since the anchoring wasn't correct.

Fix

Changed the anchoring to be in the bottom-centre of the icon so they visually stick to the proper place.

Side note

Interestingly, it turns out that Algolia's places search returns incorrect lat-lng coordinates for some addresses. E.g. 401 West Georgia Street, Vancouver is off by quite a bit. This looks like an issue on Algolia's side. E.g. looking up 401 West Georgia Street, Vancouver returns wrong coordinates on the actual Algolia page, which is strange because they're supposed to be pulling from Open Street Maps, which actually returns the right coordinates. 🤔

iconAnchor is set so that the marker doesn't float
around when zooming in and out.
The actual location of the marker is still incorrect by a small
amount, however.
@chrismclarke chrismclarke self-requested a review November 1, 2019 19:28
@chrismclarke
Copy link
Member

That is super useless of algolia! Seems to be down to rounding, created a new issue here:
#739

Copy link
Member

@chrismclarke chrismclarke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!
I'm guessing for future ref the magic formula is [sizeX/2,sizeY] as coordinates? If you have the chance it might be good to define as variables to avoid the same issue coming up again if anyone wants to change the icons (may be useful to do to have different sizes for different sized cluster icons), but happy to merge this fix for now.

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

Successfully merging this pull request may close these issues.

2 participants