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

getMarkers() getting different results #44

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

getMarkers() getting different results #44

GoogleCodeExporter opened this issue Jul 24, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

I am working on a map with a bunch of markers. In some parts of the code I call 
myMap.getMarkers() to obtain a List of them. I happen to find a different order 
within this list in every call. 
I expected the list to be in the same order as when the markers were initially 
added to the map.
Which is the logic followed by this method?
Thanks and regards

Original issue reported on code.google.com by pablol.s...@gmail.com on 16 May 2014 at 7:03

@GoogleCodeExporter
Copy link
Author

Markers and other visual objects are kept in HashMap. If you change that to 
LinkedHashMap, you will get the order. Just a small memory penalty, no 
performance loss AFAIK.

This is the line to change for markers:

https://github.com/mg6maciej/android-maps-extensions/blob/develop/android-maps-e
xtensions/src/com/androidmapsextensions/impl/MarkerManager.java#L51

Original comment by maciek.g...@gmail.com on 16 May 2014 at 7:19

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