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

Markers move from their coordinates after adding/removing class name #5912

Closed
bradsimantel opened this issue Dec 22, 2017 · 2 comments
Closed

Comments

@bradsimantel
Copy link

mapbox-gl-js version: 0.43.0

Steps to Trigger Behavior

  1. Dynamically add class name to a marker.
  2. Dynamically remove class name from that marker.
  3. Zoom in/out to see markers move from their coordinates

A demo of this behavior is available here: https://codepen.io/anon/pen/jYMBRq

Expected Behavior

Markers shouldn't move from their coordinates while zooming.

Actual Behavior

Markers move from their coordinates while zooming.

Notes

I think this same bug was previously reported in #5133 and #5151 (I modified the CodePen from #5151 for my demo), which were both resolved by #5139.

@andrewpomeroy
Copy link

andrewpomeroy commented Dec 22, 2017

Looks like you're wiping out the mapboxgl-marker class when you change className, which I presume is used as a selector to handle positioning of the markers.

https://codepen.io/andrewpomeroy/pen/GyjmZK

@bradsimantel
Copy link
Author

@andrewpomeroy: Good catch! Closing this issue.

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