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

Bug: custom markers lose exact position after moving map #5151

Closed
jd327 opened this issue Aug 16, 2017 · 4 comments
Closed

Bug: custom markers lose exact position after moving map #5151

jd327 opened this issue Aug 16, 2017 · 4 comments

Comments

@jd327
Copy link

jd327 commented Aug 16, 2017

mapbox-gl-js version: 0.39.1

Steps to Trigger Behavior

  1. Visit https://codepen.io/anon/pen/JyOvRN in latest FF or Chrome.
  2. You'll see 2 markers. Click on one of the markers.
  3. Move the map.
  4. Select another marker. Move the map again.

Expected Behavior

The markers don't lose the coordinates to which they're anchored.

Actual Behavior

The markers move a little bit and don't point to the original position.

Notes

This does not happen on v0.34.0.

@jfirebaugh
Copy link
Contributor

Duplicate of #5133.

@jd327
Copy link
Author

jd327 commented Aug 19, 2017

@jfirebaugh I am not sure what your suggestion is -- is it to set transform: translate(-50%, -50%); on the marker <div> itself? Because mapboxgl applies its own calculations as the map moves:

sn

Could you maybe show the fix on the codepen above?

@jfirebaugh
Copy link
Contributor

It's a duplicate of a bug that was already reported -- #5133 -- and has been fixed for the next release. If you need the fix immediately and are prepared to build Mapbox GL JS from source, it's in #5139.

@jd327
Copy link
Author

jd327 commented Aug 19, 2017

@jfirebaugh Ahhh, got ya! I totally missed that it's fixed for the upcoming release. Thank you for the quick reply.

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

No branches or pull requests

2 participants