You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Marker view adapter layout needs a view parent to anchor correctly #6805
When inflating a custom layout in a marker view, the layout must have a view parent to anchor itself correctly, otherwise the marker moves depending on the zoom and never reaches to correct given position.
In both GIFs you'll notice both a cat marker (custom layout marker) and a default marker using the same position. I'm centering both the markers using 0.5f, 0.5f for the anchor value.
For me, I was using my own MarkerViewAdapter that uses an ImageView, and had a sort of similar problem (also same problem when using the MarkerViewManager.ImageMarkerViewAdapter class): When the creating a new marker (inside the getView method of the adapter) the position is offset, but when I am able to reuse the convertView in getView, then the position is fine.
Do you have something similar if you say: create the cat, wait a second, remove the cat, then create the cat marker again.
Activity
dylan-chong commentedon Nov 25, 2016
For me, I was using my own MarkerViewAdapter that uses an ImageView, and had a sort of similar problem (also same problem when using the MarkerViewManager.ImageMarkerViewAdapter class): When the creating a new marker (inside the getView method of the adapter) the position is offset, but when I am able to reuse the convertView in getView, then the position is fine.
Do you have something similar if you say: create the cat, wait a second, remove the cat, then create the cat marker again.
Guardiola31337 commentedon Jun 21, 2017
Hey 👋 @dylan-chong
First of all, thanks a lot for reaching out and report your problem.
This should be fixed with #9282. Feel free to test out the latest
5.1.0-beta.5or theSNAPSHOTto verify if it's fixed.Guardiola31337 commentedon Jun 21, 2017
Going ahead and closing here.
@dylan-chong thanks again for using Mapbox and feel free to open new tickets if you find any other issues 😉